Re: Checking is TSearch2 query is valid

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Checking is TSearch2 query is valid
Дата
Msg-id 18174.1189349667@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Checking is TSearch2 query is valid  (Benjamin Arai <me@benjaminarai.com>)
Ответы Re: Checking is TSearch2 query is valid  (Benjamin Arai <me@benjaminarai.com>)
Список pgsql-general
Benjamin Arai <me@benjaminarai.com> writes:
> Is there a way to pass a query to PostgreSQL to check if the
> TSeasrch2 search text is valid?  For example,
> SELECT to_tsquery('default', '!');
> returns an error.  I want to know if there is a way  get true/false
> for the '!' portion of the query?

The generic solution to this type of problem is to write a function that
tries to do whatever-it-is-that-throws-an-error inside a plpgsql
BEGIN/EXCEPTION block, and catch the errors you are expecting.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: SQL for Deleting all duplicate entries
Следующее
От: novnov
Дата:
Сообщение: Re: Scalability Design Questions