Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6WP3-0005w8-Cq for pgsql-hackers@arkaria.postgresql.org; Mon, 13 May 2024 14:11:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s6WP3-000NEG-3J for pgsql-hackers@arkaria.postgresql.org; Mon, 13 May 2024 14:11:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6WP2-000NDk-Pg for pgsql-hackers@lists.postgresql.org; Mon, 13 May 2024 14:11:44 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6WOw-0000ZQ-2h for pgsql-hackers@postgresql.org; Mon, 13 May 2024 14:11:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 44DEBYD9738733; Mon, 13 May 2024 10:11:34 -0400 From: Tom Lane To: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= cc: Matthias van de Meent , Artur Formella , pgsql-hackers@postgresql.org Subject: Re: Allowing additional commas between columns, and at the end of the SELECT clause In-reply-to: <87bk59hp5o.fsf@wibble.ilmari.org> References: <0368c60f-abe2-4f5f-972d-7cd1e6db2382@gmail.com> <87bk59hp5o.fsf@wibble.ilmari.org> Comments: In-reply-to =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= message dated "Mon, 13 May 2024 13:28:19 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <738731.1715609494.1@sss.pgh.pa.us> Date: Mon, 13 May 2024 10:11:34 -0400 Message-ID: <738732.1715609494@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Matthias van de Meent writes: >> Single trailing commas are a feature that's more and more common in >> languages, yes, but arbitrary excess commas is new to me. Could you >> provide some examples of popular languages which have that, as I can't >> think of any. > The only one I can think of is Perl, which I'm not sure counts as > popular any more. JavaScript allows consecutive commas in array > literals, but they're not no-ops, they create empty array slots: I'm fairly down on this idea for SQL, because I think it creates ambiguity for the ROW() constructor syntax. That is: (x,y) is understood to be shorthand for ROW(x,y) (x) is not ROW(x), it's just x (x,) means what? I realize the original proposal intended to restrict the legality of excess commas to only a couple of places, but to me that just flags it as a kluge. ROW(...) ought to work pretty much the same as a SELECT list. As already mentioned, if you can get some variant of this through the SQL standards process, we'll probably adopt it. But I doubt that we want to get out front of the committee in this area. regards, tom lane