Re: BUG #2125: SELECT problem with strings containing \

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2125: SELECT problem with strings containing \
Дата
Msg-id 23146.1135697395@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2125: SELECT problem with strings containing \  ("Tony" <tonya@ananzi.co.za>)
Список pgsql-bugs
"Tony" <tonya@ananzi.co.za> writes:
> When running a query such as:
> select folder from public.folders
> where lower(folder) like '%c:\\1%'
> no rows are returned

This is not a bug --- you've forgotten that backslash is an escape
character in LIKE patterns.  You can either double it again:

    like '%c:\\\\1%'

or select a different escape character, or maybe better not have any
escape character at all:

    like '%c:\\1%' escape ''

See
http://www.postgresql.org/docs/8.1/static/functions-matching.html#FUNCTIONS-LIKE

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2126: Index usage for function value
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #2124: Error "relation with OID ... does not exist" when