IN clause behaving badly with missing comma and line break - Mailing list pgsql-bugs

From Roman Cervenak
Subject IN clause behaving badly with missing comma and line break
Date
Msg-id CAGjExY3rn0YEYnCiRkJ+R9czsmz6Fa4xkYaOaY35x6B-UC_53A@mail.gmail.com
Whole thread Raw
Responses Re: IN clause behaving badly with missing comma and line break
Re: IN clause behaving badly with missing comma and line break
List pgsql-bugs
Hello,
if you use IN() clause (I've tested in WHERE and CASE) and you forget comma between values, it is syntax error (correct behaviour). But if there is newline between those two values, suddenly it is not syntax error (query will run successfully), and all values are simply ignored. 

Examples:

WITH sample AS (SELECT 'c' AS t) SELECT CASE WHEN t IN ('a','b') THEN 1 WHEN t IN ('c'
  'd') THEN 2 END FROM sample;

WITH sample AS (SELECT 'c' AS t)
SELECT * FROM sample WHERE t IN ('a'
'c');

pgsql-bugs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: DROP DATABASE deadlocks with logical replication worker in PG 15.1
Next
From: David Rowley
Date:
Subject: Re: IN clause behaving badly with missing comma and line break