On Tue, Jan 17, 2017 at 09:25:38AM +0100, Thomas Kellerer wrote:
> I recently stumbled over the need to use a wildcard escape character for a condition that makes use of LIKE ANY,
somethinglike:
>
> 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
May I ask for clarification:
Do you need to have the _ NOT be recognized as a wildcard ?
Or do yo need to have the _ be used as an escape character ?
In the latter case I wonder whether the example was an
unlucky choice since neither "b" nor "f" need escaping. Am I
understanding you correctly that you need '_%' to have the
meaning '\%' normally would in the context of a LIKE pattern ?
Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346