Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...)
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKE ANY (...) |
| Дата | |
| Msg-id | 25377.1484656878@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [GENERAL] Is it possible to specify an ESCAPE for a wildcard search using LIKEANY (...) (Thomas Kellerer <spam_eater@gmx.net>) |
| Ответы |
[GENERAL] Re: Is it possible to specify an ESCAPE for a wildcard search usingLIKE ANY (...)
|
| Список | pgsql-general |
Thomas Kellerer <spam_eater@gmx.net> writes:
> So my question is: Is there any way to specify an alternate wildcard escape when using LIKE ANY (..)?
No, not with ESCAPE. [ manfully resists temptation to run down SQL
committee's ability to design composable syntax ... oops ]
You could do what PG does under the hood, which is to run the pattern
through like_escape():
select *
from some_table
where name like any (array[like_escape('foo_bar%', '/'),
like_escape('bar_foo%', '/')]);
If that seems too verbose, maybe build a function to apply like_escape
to each member of an array.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера