Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WgJjm-0007kW-Cl for pgsql-bugs@arkaria.postgresql.org; Fri, 02 May 2014 20:07:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WgJjl-000368-RP for pgsql-bugs@arkaria.postgresql.org; Fri, 02 May 2014 20:07:13 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WgJjl-000362-5z for pgsql-bugs@postgresql.org; Fri, 02 May 2014 20:07:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WgJji-0004Vn-Jy for pgsql-bugs@postgresql.org; Fri, 02 May 2014 20:07:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s42K79kD008029; Fri, 2 May 2014 16:07:09 -0400 From: Tom Lane To: dbaston@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #10201: Invalid input accepted with IN expression In-reply-to: <20140502200127.1403.20569@wrigleys.postgresql.org> References: <20140502200127.1403.20569@wrigleys.postgresql.org> Comments: In-reply-to dbaston@gmail.com message dated "Fri, 02 May 2014 20:01:27 -0000" Date: Fri, 02 May 2014 16:07:09 -0400 Message-ID: <8028.1399061229@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs