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.96) (envelope-from ) id 1vibYm-00AuAl-1M for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 17:00:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vibYl-008Jqp-1q for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 16:59:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vibYO-008Gy6-2l for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 16:59:37 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vibYM-001kgA-11 for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 16:59:36 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id AAC7E7A02DB; Wed, 21 Jan 2026 11:59:31 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Wed, 21 Jan 2026 11:59:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1769014771; x=1769101171; bh=CJw50qaGKTpRWT6bOgD4Jfv3mzXdmbLfAzg2Dbs6vvs=; b= Neog+aoB9jysIGsSk83ZMeMwykmnnx16VLc3nQZNL8Zp/Sh1KgAMpXxN2zlhoD8u FDwx8SKaowGuKbJb30/uqhKtupFo0pRlKGw51LOJriinkxr08MakwpC18kIcWjAy h39AxtgjtNcA6meGjO4VnnPRmPsiNbVYxVw6ec4AuSUeb9+/al8QbASolMrzOhJb r4sG6pgTfciKi8UXjR/qxB6GcVFzMpYPNB6bWgFbMtdYA/jlqE1Y/fV8NxfpXif7 gjNb6bhRsDiN2/4bwOrANCw+CVtj/DPqx4Vj5vp6Y0mN9Z4s3wfS91ICbWHtPirr eMj5s0y6+NFhsXvePlUgPw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1769014771; x=1769101171; bh=C Jw50qaGKTpRWT6bOgD4Jfv3mzXdmbLfAzg2Dbs6vvs=; b=wPXIKZx1uonba8Rf8 3pl7Cbh8F4zAVpVID+JoXTgPNqqIdUBr5Oh8d+9Tbnw5/CfzoPctvnLipYrVn0Tl bkq0lLkcFJA8BAZkCZxvrdDdT0lkdj+Uo/a3zFrGJRhT7+OQDQoxrj77wcUnXQg+ PLtu1mjs/dabpO+jAswMBNRU1hLScMx058wmN1psXhkRHGXUu5VKcmVBigBNLd+l SX6gnNCJkUjl8AjouTolJeDs9k4Kc2YySLtT/gxUgFfmdyBwFDuoEjqo+OIgsrvi 6VNEqK3DONwcFQu0bG9D9lF4OPRMJcuqIOP3O2CJby5/HPB0osjpR1ZofY45xSEQ y+9Dg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeefkedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertd dtvdejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegv ihhsvghnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepieelgfeujeeiveeige efvdejgfdvheelfeevhedtkeehtedugeeugeekgeehieetnecuffhomhgrihhnpegvihhs vghnthhrrghuthdrohhrghdphigtohhmsghinhgrthhorhdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghn thhrrghuthdrohhrghdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohephhhtrghmfhhiughssehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhg shhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Jan 2026 11:59:30 -0500 (EST) Message-ID: <4042a046-3dc9-4fc6-bfc6-62beb8492f27@eisentraut.org> Date: Wed, 21 Jan 2026 17:59:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Provide support for trailing commas To: Greg Sabino Mullane , "pgsql-hackers@lists.postgresql.org" References: Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 06.01.26 21:35, Greg Sabino Mullane wrote: > tl;dr Provide support for trailing commas, where possible and practical. I was planning to work on this, so thanks for taking the heat. ;-) I wrote a blog post about this about a year ago now: https://peter.eisentraut.org/blog/2025/02/11/how-about-trailing-commas-in-sql The intent of this was to gauge people's interest in terms of whether and how to implement this and also whether and how to standardize it. It looks like you opted for variant #2 I mentioned there. There was also a Hacker News discussion: https://news.ycombinator.com/item?id=43010365 Here is an approximate summary of the feedback. Note that the commenters are all self-selected and either care about this topic a lot either way, or they just like to correct other people on the Internet. * About 50% of the commenters who expressed a clear opinion wanted trailing commas. * About 50% of the commenters who expressed a clear opinion were instead fond of the leading-commas style: SELECT a , b , c FROM ... * A number of commenters responded that they hate the leading-commas style, undo it in code they control, or reject pull requests containing such style. * On the question for which constructs trailing commas would be most useful, besides the mentioned SELECT list and CREATE TABLE content, a number of commenters also wanted support in IN (a, b, c) lists. * There was not a lot of feedback on the question of how broadly to add support. Those who commented were about evenly split between add it everywhere and add it just in a few important places. Some more outlandish suggestions that are clearly not in scope: * Many people also wanted some kind of trailing-delimiter support for AND/OR in WHERE clauses. * Many people suggested removing commas altogether. * Or alternatively allowing commas everywhere as whitespace. (Reading the current mailing list thread and the past ones that were linked to, the arguments and spread opinions seems be pretty similar there.) A selection of other sentiments (partially paraphrased): * Just do it already. * Don't let perfect be the enemy of good. * Commenters complained about the "hackery" or "cleverness" associated with leading-commas style and other similar workarounds. * Commenters noted that they are sometimes confused when coming from other programming languages that SQL does not support trailing commas. * Some commenters noted that they specifically like certain SQL products that support trailing commas and would miss it if they had to move to a different product. * A contributor to PrestoDB noted that there is "overwhelming support" for adding trailing commas but also a "principled stand to not deviate from the spec for superficial reasons". * The lead developer of SQLite commented that he will add it "as soon as PostgreSQL adds it". I have found a few existing implementations that support some trailing commas: * BigQuery * ClickHouse * DuckDB * Snowflake * XTDB DuckDB supports trailing commas in a number of clauses, but there does not appear to be a well-defined system. BigQuery and Snowflake only supports a trailing comma in the select list. Some of this is not clearly documented. I took the above summary to the SQL standard committee in September (2025) and asked for a straw pool on how to proceed, in terms of the standard. The clear answer was that the standard committee was not interested. This was mostly expected by me, but it also now gives us clarity that we would not get ahead of the standard with this, as is sometimes raised as a concern. So, I would like to review your patch and consider this for inclusion into PostgreSQL.