Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byibn-0004Ld-DG for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Oct 2016 17:00:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1byibl-0008NC-Ae for pgsql-bugs@arkaria.postgresql.org; Mon, 24 Oct 2016 17:00:21 +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 1byib7-0007Wu-33 for pgsql-bugs@postgresql.org; Mon, 24 Oct 2016 16:59:41 +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 1byib4-0003aj-Ar for pgsql-bugs@postgresql.org; Mon, 24 Oct 2016 16:59:39 +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 u9OGxSMa028327; Mon, 24 Oct 2016 12:59:28 -0400 From: Tom Lane To: Pantelis Theodosiou cc: andreas.imboden@bl.ch, pgsql-bugs@postgresql.org Subject: Re: BUG #14394: No error raised in IN-clause when commas are missing In-reply-to: References: <20161024142841.1423.19672@wrigleys.postgresql.org> <15138.1477320391@sss.pgh.pa.us> Comments: In-reply-to Pantelis Theodosiou message dated "Mon, 24 Oct 2016 17:41:47 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28325.1477328368.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Oct 2016 12:59:28 -0400 Message-ID: <28326.1477328368@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 Pantelis Theodosiou writes: > On Mon, Oct 24, 2016 at 3:46 PM, Tom Lane wrote: >> 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. > I agree but shouldn't it run without errors when there is no newline (only > spaces or comments) as well? No, because then the syntax rule that causes the literals to be merged into a single literal doesn't apply, so you get a syntax error. > Which version of the standard has this "at least one newline"? All of them. SQL92 for instance says (see 5.2 and and 5.3 ): ::=3D { | | }... ::=3D [ ] [ ... ] [ { ... [ ... = ] }... ] 1) In a or , the sequence: ... ... ... is equivalent to the sequence ... ... 4) In a , , , or , a shall contain a . The intent of allowing separators at all is evidently to allow very long literals to be split across lines. Which is fine, but I wish they'd used some explicit syntax to specify continuation. The existing definition is pretty error-prone, as you found out. 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