Search Postgresql Archives

Re: Checking is TSearch2 query is valid

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

 



Benjamin Arai <me@xxxxxxxxxxxxxxxx> writes:
> Is there a way to pass a query to PostgreSQL to check if the  
> TSeasrch2 search text is valid?  For example,
> SELECT to_tsquery('default', '!');
> returns an error.  I want to know if there is a way  get true/false  
> for the '!' portion of the query?

The generic solution to this type of problem is to write a function that
tries to do whatever-it-is-that-throws-an-error inside a plpgsql
BEGIN/EXCEPTION block, and catch the errors you are expecting.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[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