public inbox for [email protected]  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [PATCH] Provide support for trailing commas
Date: Wed, 7 Jan 2026 09:06:54 -0500
Message-ID: <CAKAnmmJx7C5APcw-hE2+EpM+9biova-5j+U-xHU3gGqkfd=vhw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAKAnmmKVwP=yr8t8p8_QtrBFjyENLZyPxscJh4UrkCeqMQuhrw@mail.gmail.com>
	<[email protected]>

On Tue, Jan 6, 2026 at 3:48 PM Tom Lane <[email protected]> wrote:

> Indeed.  I think it carries substantial risk of creating large parsing
> problems down the road, when we try to integrate whatever random syntax the
> SQL committee comes up with next.  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 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


view thread (17+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Provide support for trailing commas
  In-Reply-To: <CAKAnmmJx7C5APcw-hE2+EpM+9biova-5j+U-xHU3gGqkfd=vhw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox