Re: how to escape _ in select

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how to escape _ in select
Дата
Msg-id 20369.1280342060@sss.pgh.pa.us
обсуждение исходный текст
Ответ на how to escape _ in select  (Wes James <comptekki@gmail.com>)
Список pgsql-sql
Wes James <comptekki@gmail.com> writes:
> I'm trying to do this:
> select * from table where field::text ilike '%\_%';

> but it doesn't work.

You need to double the backslash, because one level of
backslash-escaping will be eaten by the string literal parser.
In the above example, the actual string value seen by ILIKE
is just %_%, so of course it doesn't do what you want.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Wes James
Дата:
Сообщение: Re: how to escape _ in select
Следующее
От: Wes James
Дата:
Сообщение: Re: how to escape _ in select