[BUGS] BUG #14512: Backslashes in LIKE

Поиск
Список
Период
Сортировка
От vojta.rylko@gmail.com
Тема [BUGS] BUG #14512: Backslashes in LIKE
Дата
Msg-id 20170124172505.1431.56735@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: [BUGS] BUG #14512: Backslashes in LIKE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: [BUGS] BUG #14512: Backslashes in LIKE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14512
Logged by:          Vojtěch Rylko
Email address:      vojta.rylko@gmail.com
PostgreSQL version: 9.5.5
Operating system:   Linux 3.19.0-32-generic x86_64
Description:

Hi, LIKE behaves differently depending on left side.

> select 1 where '\' like '\\\'; -- one and three backslashes
 ?column? 
----------
(0 rows)

> select 1 where '\\' like '\\\'; -- two and three backslashes
ERROR:  LIKE pattern must not end with escape character


The same behaviour occurs also with usage of table:

root=# create table t (a varchar);
CREATE TABLE
root=# insert into t values ('\'); -- one backslash
INSERT 0 1
root=# select * from t where t.a like '\\\'; -- three backslashes
 a 
---
(0 rows)

root=# insert into t values ('\\'); -- two backslashes
INSERT 0 1
root=# select * from t where t.a like '\\\'; -- three backslashes
ERROR:  LIKE pattern must not end with escape character


Cheers,
Vojta Rylko, vry.cz


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: adrian.klaver@aklaver.com
Дата:
Сообщение: [BUGS] BUG #14511: Set timezone to local
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [BUGS] BUG #14512: Backslashes in LIKE