BUG #5535: Backslash in condition for LIKE statement is not seen

Поиск
Список
Период
Сортировка
От Jeff Benjamin
Тема BUG #5535: Backslash in condition for LIKE statement is not seen
Дата
Msg-id 201007012026.o61KQcRr024009@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #5535: Backslash in condition for LIKE statement is not seen  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      5535
Logged by:          Jeff Benjamin
Email address:      jeff@ivertex.com
PostgreSQL version: 8.3.8
Operating system:   MacOSX, Linux
Description:        Backslash in condition for LIKE statement is not seen
Details:

Seems one cannot use a backslash character in a LIKE condition.

backslashprob=# create table test ( pattern varchar(50) );
CREATE TABLE
backslashprob=# insert into test (pattern) values ('\\w{12}');
INSERT 0 1
backslashprob=# select * from test;
 pattern
---------
 \w{12}
(1 row)

backslashprob=# select * from test where pattern like '\\w%';
 pattern
---------
(0 rows)

backslashprob=# select * from test where pattern like E'\\w%';
 pattern
---------
(0 rows)

backslashprob=# select * from test where pattern like '%w%';
 pattern
---------
 \w{12}
(1 row)

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5531: REGEXP_ REPLACE causes connection drop
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #5535: Backslash in condition for LIKE statement is not seen