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 1vdUC9-001Bel-1q for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Jan 2026 14:07:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vdUC7-00EIBz-2s for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Jan 2026 14:07:28 +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.96) (envelope-from ) id 1vdUC7-00EIBp-1t for pgsql-hackers@lists.postgresql.org; Wed, 07 Jan 2026 14:07:28 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vdUC6-004itN-3D for pgsql-hackers@lists.postgresql.org; Wed, 07 Jan 2026 14:07:27 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7caf5314847so1324087a34.0 for ; Wed, 07 Jan 2026 06:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767794846; x=1768399646; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Gnh5CRscxjwLtsEyCMNVshFdMtcwzbMVsCTj0N35IRE=; b=CBE+xOnji49RN/0fgsbxHwI1xZ35OGNfgvOnI0WVfOwHCgE8HTDe2G1l1wqZiAu5bS HQCgvGHPt1NZOJ2+lxO8oAT+LYA+ZemYN+2DxzHmINY8vbuyUWWH/rFb5ATkg4IYJv26 qtsYg5coQSNpW7YL9nqDYL5DQrcioSu19gd7+1pA9F/U7/OfkSoyDnvTYq9KHLRfKFXo OMPDOd2CIOxZSYiQQWQp4vP4o6aYBwd5mDH0IukDSj+C4+9DV62Qe2DYI5kjt+CNyFbc Fq09aKqM/XRRTjkE/2SytpG1ChIIrxmnsPvVNlV2lhXUeGZdEhR46wLz/2+z+W1csDrM 8ifg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767794846; x=1768399646; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Gnh5CRscxjwLtsEyCMNVshFdMtcwzbMVsCTj0N35IRE=; b=ZSoxIRi+7wwwMxtNvM1q7rqE7fNHVYI02yhvRKzJyOlua6ZrHzFvFE957t97SnK9+x TGSRAxild1wJkcn35w3HAWvlQcMAD1DbpNXyWLfB9544RY7w19m3vl2ow4nlnruUqbzO WERS88tj9SvFaZF76MY4DRt2JB5Rd70O2EgF4zUloAzXUqbL007+hIQiJ7Ju/LKx4YdW PMVZji+OPBYQTkAb0+PQSe2MlfXqcCx9Rc6MKHSsSYi+XS7kF47eyzJaDaoKw2U7rIR7 IaxPRM9UIl3nQaK+r4KL6pGc0CLuwgnt7MywGJCfzq3Ba+92AkgtCXrb9Xvex8x1U65c rEuA== X-Gm-Message-State: AOJu0YwvKmOwUAQiY2lkGj3yer/iOWkasQ1TV1FN+yZQsqX9kOWH5TIl xhA4Y7sTLsSCy3ppIVj/44vdqJoPNIci+plniE59teMlMW/+pEHXFO4imwTll4zsTX+f9Kvhh2x 6RsTT/m/iCfAmj4vNrWVXS1TGSEL8FDxeniec X-Gm-Gg: AY/fxX4H3ycS4FmYGjNTLvjFjdIYfjKXVtTELtgvil5XbqxOZf7PmbGIKHFz4zndZCo /UetAamCTkBVnIf71lH/+aOACjRP5fHRkSiz71XPswiLGIWrG6ipDEccwZpiPSrUezRb5FOxLXm WC9Z/e8pHQhF4Lrdwjn78S6syKRXIouWhVEEYB3Bgi8wy0VLAKe4hD2j7Suaj75ry07cJXo2CQg JMC5sA+fexlTJRg1dsWnvGSdE8o91n8WHDkcLqCLCj7yxPXqvRiC9khwd1m5dAT4ekKGU+ZfsVK YthtLUJEjHaFG3SJYlVrq8gPHGiIEg== X-Google-Smtp-Source: AGHT+IHJN1j0j1cVjueNkvWZ6Q4bidrjvbO7X4VtrgML8o0D9kxZyJPo2Gtj0+LFKkccsziSSTLci3bQjmtA5Sslmdo= X-Received: by 2002:a05:6820:7511:b0:659:9a49:904d with SMTP id 006d021491bc7-65f54eda43bmr760784eaf.24.1767794845882; Wed, 07 Jan 2026 06:07:25 -0800 (PST) MIME-Version: 1.0 References: <1619826.1767732539@sss.pgh.pa.us> In-Reply-To: <1619826.1767732539@sss.pgh.pa.us> From: Greg Sabino Mullane Date: Wed, 7 Jan 2026 09:06:54 -0500 X-Gm-Features: AQt7F2pOjIXVDPKFuJpf81Ao96dI7CCphhKX7ktIz2Oo_lv8JsUX0W1uERWi7ZE Message-ID: Subject: Re: [PATCH] Provide support for trailing commas To: Tom Lane Cc: "pgsql-hackers@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000d31ba10647cccfec" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d31ba10647cccfec Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 6, 2026 at 3:48=E2=80=AFPM Tom Lane wrote: > Indeed. I think it carries substantial risk of creating large parsing > problems down the road, when we try to integrate whatever random syntax t= he > SQL committee comes up with next. And frankly, I don't agree that it'd b= e > beneficial. > Hmmm, I was partly inspired to write this by your comment in the second link you referenced, in which you said: > Yeah, a more principled approach would be to not special-case target > lists, but to allow one (and only one) trailing comma everywhere: > select, order by, group by, array constructors, row constructors, > everything that looks like a function call, etc. If it can be made to work everywhere, that would get my vote. So, this is an attempt to be more comprehensive, which has been one of the major critiques of previous attempts to apply things to a small subset of the things we parse. No, it's not yet in the SQL standard, but why not be more liberal in what we accept, and not have people invent various workaround hacks (e.g. dummy columns)? Because the parser eats the comma, there are no behavioral changes post-parsing. Unsurprisingly, I also don't agree that new SQL committee changes will be that hard to support around some trailing comma support. The syntax moves slowly, and very few things will impact our comma-separated lists. The most likely things is additional modifiers e.g. RESTART IDENTITY but once we are handling one, we already have a framework in place to handle future ones. Cheers, Greg --000000000000d31ba10647cccfec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Jan 6, 2026 at 3:48=E2=80=AFPM To= m Lane <tgl@sss.pgh.pa.us> w= rote:
Indeed.=C2=A0 I think it carries substan= tial risk of creating large parsing problems down the road, when we try to = integrate whatever random syntax the SQL committee comes up with next.=C2= =A0 And frankly, I don't agree that it'd be beneficial.

Hmmm, I was partly inspired to write this by your = comment in the second link you referenced, in which you said:

> Yeah, a more princi= pled approach would be to not special-case target
> lists, but to allow one (and only one) trailing comma everyw= here:
> select, order by, group by, a= rray constructors, row constructors,
>= ; everything that looks like a function call, etc.


=
If it can be made to work everywhere, that would get my vote= .

So, this is an attempt to be more compreh= ensive, which has been one of the major critiques of previous attempts to a= pply things to a small subset of the things we parse.

<= div>No, it's not yet in the SQL standard, but why not be more liberal i= n what we accept, and not have people invent various workaround hacks (e.g.= dummy columns)? Because the parser eats the comma, there are no behavioral= changes post-parsing.

Unsurprisingly, I also don&= #39;t agree that new SQL committee changes will be that hard to support aro= und some trailing comma support. The syntax moves slowly, and very few thin= gs will impact our comma-separated lists. The most likely things is additio= nal modifiers e.g. RESTART IDENTITY but once we are handling one, we alread= y have a framework in place to handle future ones.


Cheers,
Greg

--000000000000d31ba10647cccfec--