Re: BUG #14394: No error raised in IN-clause when commas are missing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14394: No error raised in IN-clause when commas are missing
Дата
Msg-id 15138.1477320391@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14394: No error raised in IN-clause when commas are missing  (andreas.imboden@bl.ch)
Ответы Re: BUG #14394: No error raised in IN-clause when commas are missing  (Pantelis Theodosiou <ypercube@gmail.com>)
Список pgsql-bugs
andreas.imboden@bl.ch writes:
> -- no comma after 'two', no error message, incorrect result
> select sum(cvalue) from abug =

>  where cname in (
>     'one', =

>     'two' =

>     'three', =

>     'four', =

>     'five'); =


This is not a bug, it's required by the SQL standard's syntax for
string literals.  Per the manual:

    Two string constants that are only separated by whitespace *with
    at least one newline* are concatenated and effectively treated as
    if the string had been written as one constant.

https://www.postgresql.org/docs/9.6/static/sql-syntax-lexical.html#SQL-SYN=
TAX-CONSTANTS

            regards, tom lane

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

Предыдущее
От: andreas.imboden@bl.ch
Дата:
Сообщение: BUG #14394: No error raised in IN-clause when commas are missing
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: BUG #14394: No error raised in IN-clause when commas are missing