View Single Post

   
  #6 (permalink)  
Old 04-12-2008, 06:06 AM
Teodor Sigaev
 
Posts: n/a
Default Re: tsearch2 error msg

> 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/

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply With Quote