Tsearch2: casting text to tsquery

From: Alexander Presber <aljoscha(at)weisshuhn(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Tsearch2: casting text to tsquery
Date: 2005-11-16 09:17:34
Message-ID: 7401E94B-9890-40A9-A50D-E50867864906@weisshuhn.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Markus Wollny 2005-11-16 10:16:42 Re: invalid UTF-8 byte sequence detected
Previous Message Martijn van Oosterhout 2005-11-16 06:43:16 Re: Trouble with recursive trigger