Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcardsearch using LIKE ANY (...)
В списке pgsql-general по дате отправления:
| От | Karsten Hilbert |
|---|---|
| Тема | Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcardsearch using LIKE ANY (...) |
| Дата | |
| Msg-id | 20170117134226.vmwb3dfmqcpy2ezx@hermes.hilbert.loc обсуждение |
| Ответ на | [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKEANY (...) (Thomas Kellerer <spam_eater@gmx.net>) |
| Список | pgsql-general |
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
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера