On Wed, 18 Jan 2023 at 21:03, Roman Cervenak <roman@cervenak.info> wrote:
> if you use IN() clause (I've tested in WHERE and CASE) and you forget comma between values, it is syntax error
(correctbehaviour). 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;
This is not a bug. See 4.1.2.1. String Constants in [1].
David
[1] https://www.postgresql.org/docs/current/sql-syntax-lexical.html