| От | Tom Lane |
|---|---|
| Тема | Re: Escaping underscores in LIKE |
| Дата | |
| Msg-id | 6656.984148794@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Escaping underscores in LIKE ("Richard Huxton" <dev@archonet.com>) |
| Список | pgsql-general |
"Richard Huxton" <dev@archonet.com> writes:
>> You need more backslashes. Don't forget the string-literal parser eats
>> one level of backslashes, before LIKE ever gets to see the pattern.
> Thanks Tom, as a 2-stage process it all makes sense. Tried it out in PHP too
> and I end up with four backslashes (3 stages).
> Another DOH! item for my notes.
BTW, in 7.1 you can do
foo LIKE 'a#_b' ESCAPE '#'
(for '#' use whatever you want) to switch to a different escape
character that's not special to upstream processing. Probably nicer
than dealing with four or more backslashes ...
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера