Re: Safe usage of tsearch2: to_tsquery('') - Mailing list pgsql-general

From Tom Lane
Subject Re: Safe usage of tsearch2: to_tsquery('')
Date
Msg-id 16851.1186241470@sss.pgh.pa.us
Whole thread Raw
In response to Safe usage of tsearch2: to_tsquery('')  (cluster <skrald@amossen.dk>)
Responses Re: Safe usage of tsearch2: to_tsquery('')  (cluster <skrald@amossen.dk>)
List pgsql-general
cluster <skrald@amossen.dk> writes:
> In a web application I would like to use tsearch2 to search for by-user
> entered key words. That is, the user provides the keywords in a space
> separated list in some input text field. For that I use
> to_tsquery('<user keywords>') but I would like to do this in a safe way
> so that the user cannot misuse to_tsquery() by entering some harmful string.

Isn't plainto_tsquery() what you're looking for?

            regards, tom lane

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_restore UTF8 problem
Next
From: Tom Lane
Date:
Subject: Re: could not [extend relation|write block N of temporary file|write to hash-join temporary file]