Re: Help please - completely baffled by quoting

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Help please - completely baffled by quoting
Дата
Msg-id 200406201506.38447.peter_e@gmx.net
обсуждение исходный текст
Ответ на Help please - completely baffled by quoting  ("Tim Robinson" <tim.robinson@blueyonder.co.uk>)
Ответы Re: Help please - completely baffled by quoting  ("Tim Robinson" <tim.robinson@blueyonder.co.uk>)
Список pgsql-general
Tim Robinson wrote:
>     select * from temp where a like 'a\\\'%'
>
> this should return all strings starting with a\' but it returns
> nothing!!!

\ is also the quoting character of LIKE, in addition to being a quoting
character on the string literal level.  If you want all strings
starting with a\' then use something like:

a LIKE 'a\\\'%' ESCAPE '!'

where '!' selects some other escape character for LIKE that doesn't get
in the way.  The documentation on LIKE contains the details on this
mechanism.


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

Предыдущее
От: "Tim Robinson"
Дата:
Сообщение: Help please - completely baffled by quoting
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_proc_proname_args_nsp_index error