Re: IN clause behaving badly with missing comma and line break

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: IN clause behaving badly with missing comma and line break
Дата
Msg-id CAApHDvrZKqZOMQYf=f5C5j3fP+Ls_3rY6=PZD8AcWZdf2byvWg@mail.gmail.com
обсуждение исходный текст
Ответ на IN clause behaving badly with missing comma and line break  (Roman Cervenak <roman@cervenak.info>)
Список pgsql-bugs
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



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Roman Cervenak
Дата:
Сообщение: IN clause behaving badly with missing comma and line break
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Logical Replica ReorderBuffer Size Accounting Issues