Re: Migrating between versions. Problem with regexp

Поиск
Список
Период
Сортировка
От Kaloyan Iliev Iliev
Тема Re: Migrating between versions. Problem with regexp
Дата
Msg-id 4132006A.8050307@faith.digsys.bg
обсуждение исходный текст
Ответ на Migrating between versions. Problem with regexp  (Kaloyan Iliev Iliev <news1@faith.digsys.bg>)
Ответы Re: Migrating between versions. Problem with regexp  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Dear Tom Lane,
I still haven't read all the documentation but I find the following.
If I escape with \\  latin  letters it OK, but if escape with \\
cyrillic letters then it is a mistake.

libvar=# select '\\a\ÿ' ~* '\\a\ÿ';
 ?column?
----------
 f
(1 row)

libvar=# select '\\a\\ÿ' ~* '\\a\\ÿ';
ERROR:  invalid regular expression: invalid escape \ sequence
libvar=# select '\\a\\ÿ' ~* '\\a\ÿ';
 ?column?
----------
 f
(1 row)

libvar=# select '\\a\ÿ' ~* '\\a\\ÿ';
ERROR:  invalid regular expression: invalid escape \ sequence

So I understand that you can't adapt it to all languages and alphabets
but in case this is an error and can be fixed I report it.
Kaloyan

Tom Lane wrote:

>Kaloyan Iliev Iliev <news1@faith.digsys.bg> writes:
>
>
>>libvar=# select '\\a\\à\\à\\.' ~ '\\a\\à\\à\\.';
>>ERROR:  invalid regular expression: invalid escape \ sequence
>>
>>
>
>7.4 and later are stricter about the use of \ than prior versions; see
>http://www.postgresql.org/docs/7.4/static/functions-matching.html#POSIX-ESCAPE-SEQUENCES
>You could go back to (approximately) the old behavior by changing
>regex_flavor to "extended".
>
>            regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>
>
>
>

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

Предыдущее
От: Kaloyan Iliev Iliev
Дата:
Сообщение: Re: Migrating between versions. Problem with regexp
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Primary key inheritance problem