Re: Like problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Like problem
Дата
Msg-id 16828.1202921561@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Like problem  (Richard Huxton <dev@archonet.com>)
Ответы Re: Like problem  ("Campbell, Lance" <lance@uiuc.edu>)
Re: Like problem  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
Richard Huxton <dev@archonet.com> writes:
> Campbell, Lance wrote:
>> WARNING:  nonstandard use of escape in a string literal
>> LINE 1: ...ct c1 from t1 where c1 like '%abc\_%';

> Either indicate you are using an escaped string: LIKE E'%abc\_%'

Actually that's wrong, what he'd need is LIKE E'%abc\\_%'
(or omit the E and ignore the warning).

Alternatively, set standard_conforming_strings to TRUE and write
LIKE '%abc\_%' ... but beware that that might break other parts
of your app that are expecting backslash to be special.

> Or, change the escape character: LIKE '%abcQ_%' ESCAPE 'Q'

Yeah, this might be the easiest localized solution.
        regards, tom lane


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Like problem
Следующее
От: "Campbell, Lance"
Дата:
Сообщение: Re: Like problem