Re: Proposal: SELECT * EXCLUDE (...) command

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hunaid Sohail <hunaidpgml(at)gmail(dot)com>
Cc: John Naylor <johncnaylorls(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal: SELECT * EXCLUDE (...) command
Date: 2026-01-08 15:42:09
Message-ID: 1964798.1767886929@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hunaid Sohail <hunaidpgml(at)gmail(dot)com> writes:
> On Thu, Jan 8, 2026 at 3:27 PM John Naylor <johncnaylorls(at)gmail(dot)com> wrote:
>> This has been proposed before. You can see one such discussion here:
>> https://www.postgresql.org/message-id/flat/CANcm6wbR3EG7t-G=Txy64Yt8nR6YbpzFRuTewJQ+kCq=rZ8M2A(at)mail(dot)gmail(dot)com

> This looks like an older discussion focused mainly on syntax, scope, and
> keyword concerns. There was some support for the feature, but no
> implementation.

One thing that I think has changed since that 2011 thread is that
we've become far more aware that the SQL standard is a moving target.
I would now resist adding something like this on the grounds that
it's too likely to conflict with something the standards committee
does down the road. They might standardize the same functionality
with a different syntax, or they could invent some syntax involving
EXCLUDING that conflicts enough that we can't support it alongside
this. This has already happened to us --- the business with how
named arguments for functions are written caused a lot of pain
both for us and for our users.

Admittedly, the fact that we now have a couple of project members who
sit on that committee makes it less likely that we'd get blindsided in
the same way again. But that doesn't mean I'm eager to get out front
of the standard in places where this sort of conflict is foreseeable.

In short: I'd recommend going and seeing if you can sell this idea
to the SQL committee. We'd be much more likely to accept an
implementation if the syntax got accepted by them.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-01-08 15:54:35 Re: Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
Previous Message Jelte Fennema-Nio 2026-01-08 15:40:35 Re: [PATCH] Provide support for trailing commas