From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: anmol.mohanty@salesforce.com
Subject: BUG #18765: Inconsistent behaviour and errors with LIKE
Date: Fri, 03 Jan 2025 16:47:05 +0000
Message-ID: <18765-6c26d2047e6f5143@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18765
Logged by: Anmol Mohanty
Email address: anmol.mohanty@salesforce.com
PostgreSQL version: 17.0
Operating system: NA(used fiddle tool at sqlfiddle.com)
Description:
select 'a\' like 'a\'; -- error - LIKE pattern must not end with escape
character
select 'a' like 'a\'; -- f - query runs
This doesn't make sense. The LIKE pattern is incorrect in both.
I've also checked around constant folding and runtime non-literal values by
inserting into cte's and temp tables. Same outcome.
```
WITH a AS (SELECT 'xyz' AS value)
SELECT value LIKE 'xyz\' AS result
FROM a;
```
f
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, anmol.mohanty@salesforce.com
Subject: Re: BUG #18765: Inconsistent behaviour and errors with LIKE
In-Reply-To: <18765-6c26d2047e6f5143@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