Tsearch2: casting text to tsquery

Поиск
Список
Период
Сортировка
От Alexander Presber
Тема Tsearch2: casting text to tsquery
Дата
Msg-id 7401E94B-9890-40A9-A50D-E50867864906@weisshuhn.de
обсуждение исходный текст
Ответы Re: Tsearch2: casting text to tsquery
Список pgsql-general
Hello,

I have a question that arose while using tsearch on a large database
of book information.

In order to inject unstemmed + stemmed versions of searchstrings into
a query we want to cast an expression of type text to tsquery.
Unfortunately

   SELECT 'word'::tsquery

(where the literal 'word' is of type 'unknown' seemingly) works just
fine while e.g.

   SELECT ('word' || '&fullword')::tsquery

or, simpler

   SELECT 'word&fullword'::text::tsquery

gives

   ERROR:  cannot cast type text to tsearch2.tsquery

How can we work around that? Thanks for any help

Sincerely yours
Alexander Presber




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

Предыдущее
От: Sebastian Böck
Дата:
Сообщение: Re: Bug with index-usage?
Следующее
От: Thies C Arntzen
Дата:
Сообщение: shouldn't postgres know the numer of rows in a (sorted) result-set before returning the first row?