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

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)
Date: 2017-01-17 14:27:57
Message-ID: o5l9l8$io4$1@blaine.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Karsten Hilbert schrieb am 17.01.2017 um 14:42:
>> 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
>
> May I ask for clarification:
>
> Do you need to have the _ NOT be recognized as a wildcard ?

Yes, the underscore should NOT be a wildcard in this case.

Now that I think about it - my question actually doesn't make sense.

In order to be able to _use_ an escape character I would need to supply one.
And if I can supply one, I can use the standard one as well.

Sorry for the noise

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2017-01-17 14:49:19 Re: Re: Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)
Previous Message Karsten Hilbert 2017-01-17 13:42:27 Re: Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)