Re: BUG #10201: Invalid input accepted with IN expression

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #10201: Invalid input accepted with IN expression
Дата
Msg-id 8028.1399061229@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #10201: Invalid input accepted with IN expression  (dbaston@gmail.com)
Ответы Re: BUG #10201: Invalid input accepted with IN expression
Список pgsql-bugs
dbaston@gmail.com writes:
> If two items in an IN expression are separated by a newline instead of a
> comma, those items will be ignored with no error.

> CREATE TABLE testing (id varchar(1));
> INSERT INTO testing VALUES ('1'), ('2'), ('3'), ('4'), ('5');

> -- Missing comma produces a syntax error
> SELECT * FROM testing WHERE id IN ('1'  '2', '3');

> -- Unless there is a newline
> SELECT * FROM testing WHERE id IN ('1'
> '2', '3');

This is not a bug; what you've got there is the SQL-standard way of
breaking a literal across lines.  Compare

select '1'
'2', '3';
 ?column? | ?column?
----------+----------
 12       | 3
(1 row)

            regards, tom lane

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: BUG #10201: Invalid input accepted with IN expression
Следующее
От: Daniel Baston
Дата:
Сообщение: Re: BUG #10201: Invalid input accepted with IN expression