Re: BUG #14512: Backslashes in LIKE

From: Alex Malek <magicagent(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14512: Backslashes in LIKE
Date: 2017-03-17 18:16:20
Message-ID: CAGH8cccDiRCwUeh4OMRsMEDWEc8aQWJsORw4O05nQgUkO7p7Yw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2017-03-17 18:25:26 Re: BUG #14512: Backslashes in LIKE
Previous Message Osahon Oduware 2017-03-17 14:56:47 QGIS Seem To Bypass PostgreSQL/PostGIS User Privileges/Permissions