Search Postgresql Archives

Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)

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

 



I recently stumbled over the need to use a wildcard escape character for a condition that makes use of LIKE ANY, something like:

   select *
   from some_table
   where name like any (array['foo_bar%', 'bar_foo%']) escape '/';

so that the underscore wouldn't be treated as a wildard (I can't really change the values _inside_ the array as they are user_provided).

The above throws a syntax error. 

So my question is: Is there any way to specify an alternate wildcard escape when using LIKE ANY (..)? 

Thomas





-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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