Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bygXE-000721-7Y for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Oct 2016 14:47:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bygXD-0003s9-GK for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Oct 2016 14:47:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bygWY-00039B-CT for pgsql-bugs@postgresql.org; Mon, 24 Oct 2016 14:46:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bygWP-00018s-P3 for pgsql-bugs@postgresql.org; Mon, 24 Oct 2016 14:46:49 +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 u9OEkVSo015139; Mon, 24 Oct 2016 10:46:31 -0400 From: Tom Lane To: andreas.imboden@bl.ch cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14394: No error raised in IN-clause when commas are missing In-reply-to: <20161024142841.1423.19672@wrigleys.postgresql.org> References: <20161024142841.1423.19672@wrigleys.postgresql.org> Comments: In-reply-to andreas.imboden@bl.ch message dated "Mon, 24 Oct 2016 14:28:41 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15137.1477320391.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Oct 2016 10:46:31 -0400 Message-ID: <15138.1477320391@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) 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 andreas.imboden@bl.ch writes: > -- no comma after 'two', no error message, incorrect result > select sum(cvalue) from abug=20 > where cname in ( > 'one',=20 > 'two'=20 > 'three',=20 > 'four',=20 > 'five');=20 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-SYNT= AX-CONSTANTS regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs