Re: tsearch2 error msg - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: tsearch2 error msg
Date
Msg-id 452297F2.8050401@sigaev.ru
Whole thread Raw
In response to Re: tsearch2 error msg  (AgentM <agentm@themactionfaction.com>)
List pgsql-hackers
> This is great news- previously, I was using various regexes to sanitize 
> input into user-accessible search fields. Would it be build in some 
> simple query language?
> 
> "sam AND spade"
> "blue OR yellow"
> "(same AND spade) OR (blue AND yellow)"

That's exactly to_tsquery syntax, just change AND to & and OR to |. :)
So, if you can validate AND/OR then you can validate &/| syntax or validate 
AND/OR and change they to tsquery's equivalents.



-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: PG qsort vs. Solaris
Next
From: "Magnus Hagander"
Date:
Subject: Re: src/tools/msvc usage instructions