[GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKEANY (...) - Mailing list pgsql-general

From Thomas Kellerer
Subject [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKEANY (...)
Date
Msg-id o5kkdt$il6$1@blaine.gmane.org
Whole thread Raw
Responses Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcardsearch using LIKE ANY (...)  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general
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 (I can't really change the values _inside_ the array as they
areuser_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



pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: [GENERAL] 9.6.1: INSERT with PK as serial
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)