From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: pavel@bnovo.ru
Subject: BUG #15421: Error: LIKE pattern must not end with escape character
Date: Fri, 05 Oct 2018 13:11:43 +0000
Message-ID: <15421-6e32dfa391cfae4a@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15421
Logged by: Pavel Shapovalov
Email address: pavel@bnovo.ru
PostgreSQL version: 9.4.19
Operating system: Linux (4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u)
Description:
Schema:
CREATE TABLE public.tmp (
id integer NOT NULL,
name text
);
Test data:
INSERT INTO tmp VALUES(1, 'test')
If I try to query the table with LIKE statement:
SELECT COUNT(id) AS "records_found" FROM "tmp" WHERE lower("tmp"."name")
LIKE 't\' I get the error "Error: LIKE pattern must not end with escape
character". The same situation is for statement SELECT COUNT(id) AS
"records_found" FROM "tmp" WHERE lower("tmp"."name") LIKE 'te\' and others
if the LIKE pattern matches the beginning of the name field in any record.
If I try to query the statement SELECT COUNT(id) AS "records_found" FROM
"tmp" WHERE lower("tmp"."name") LIKE 'rs\' and others that do not match any
records, there are no errors at all.
This behaviour is not clear from the documentation. Is it a bug or
undocumented feature?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pavel@bnovo.ru
Subject: Re: BUG #15421: Error: LIKE pattern must not end with escape character
In-Reply-To: <15421-6e32dfa391cfae4a@postgresql.org>
References: <15421-6e32dfa391cfae4a@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox