Search Postgresql Archives

Tsearch2: casting text to tsquery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux