Re: [BUGS] BUG #14512: Backslashes in LIKE - Mailing list pgsql-bugs

From Alex Malek
Subject Re: [BUGS] BUG #14512: Backslashes in LIKE
Date
Msg-id CAGH8cccDiRCwUeh4OMRsMEDWEc8aQWJsORw4O05nQgUkO7p7Yw@mail.gmail.com
Whole thread Raw
In response to [BUGS] BUG #14512: Backslashes in LIKE  (vojta.rylko@gmail.com)
Responses Re: [BUGS] BUG #14512: Backslashes in LIKE  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs

Given the current behavior the same query will work or raise on error based on context.
That is pretty confusing.

Consider:

 foo=> CREATE TABLE bar (a varchar);
CREATE TABLE
foo=> SELECT * FROM bar WHERE a LIKE 'e\';
 a 
---
(0 rows)

foo=> INSERT INTO bar VALUES ('e');
INSERT 0 1
foo=> SELECT * FROM bar WHERE a LIKE 'e\';
 a 
---
(0 rows)

foo=> INSERT INTO bar VALUES ('ee');
INSERT 0 1
foo=> SELECT * FROM bar WHERE a LIKE 'e\';
ERROR:  LIKE pattern must not end with escape character

pgsql-bugs by date:

Previous
From: Osahon Oduware
Date:
Subject: [BUGS] QGIS Seem To Bypass PostgreSQL/PostGIS User Privileges/Permissions
Next
From: "David G. Johnston"
Date:
Subject: Re: [BUGS] BUG #14512: Backslashes in LIKE