The following bug has been logged on the website:
Bug reference: 18765
Logged by: Anmol Mohanty
Email address: anmol(dot)mohanty(at)salesforce(dot)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