Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJIrf-0000v5-4K for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Apr 2019 14:27:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hJIrb-0008Ot-Lj for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Apr 2019 14:27:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJIrb-0008BE-Bn for pgsql-bugs@lists.postgresql.org; Wed, 24 Apr 2019 14:27:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJIrY-0002iX-7N for pgsql-bugs@lists.postgresql.org; Wed, 24 Apr 2019 14:27:06 +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 x3OEQvRW011396; Wed, 24 Apr 2019 10:26:57 -0400 From: Tom Lane To: Alvaro Herrera cc: Jan =?iso-8859-1?Q?Skyd=E1nek?= , pgsql-bugs@lists.postgresql.org Subject: Re: bug: evil autoConcat when each string is on new line In-reply-to: <20190424124459.GA26812@alvherre.pgsql> References: <20190424124459.GA26812@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Wed, 24 Apr 2019 08:44:59 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <11394.1556116017.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 24 Apr 2019 10:26:57 -0400 Message-ID: <11395.1556116017@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2019-Apr-24, Jan Skyd=C3=A1nek wrote: >> Works (definitely NOT expected): >> SELECT >> 'aaa' >> 'bbb' >> 'ccc' >> ; -- result is: 'aaabbbccc' >> = >> I really hope this behavior is not intentional. > Actually it's the SQL standard that defines that it must work in exactly > that way. Yeah. Quoting from SQL99: ::=3D { | }... ::=3D [ ] [ ... ] [ { [ ... ] = }... ] Syntax Rules 1) In a or , the sequence: ... ... is equivalent to the sequence ... ... NOTE 47 - The s in the equivalent sequence are in the same sequence and relative sequence as in the original . 5) In a , , , , or , a shall contain a . Don't ask us, we just implement it. regards, tom lane