public inbox for [email protected]
help / color / mirror / Atom feedFrom: Robert Treat <[email protected]>
To: Christoph Berg <[email protected]>
To: Peter Eisentraut <[email protected]>
To: Hunaid Sohail <[email protected]>
To: [email protected]
Subject: Re: Proposal: SELECT * EXCLUDE (...) command
Date: Mon, 16 Feb 2026 09:24:49 -0500
Message-ID: <CABV9wwPVNJJSOnFZhTfAVrotzNXTmKg8H9gyvY+_V9uqw5mhMw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAMWA6yb9GGiJbe9iU88yjurVQCsFgZvW7xSxa0aFLC0Wtz4Aqg@mail.gmail.com>
<[email protected]>
<[email protected]>
On Thu, Jan 15, 2026 at 8:15 AM Christoph Berg <[email protected]> wrote:
>
> Re: Peter Eisentraut
> > => select * exclude (foo) from t1, t2;
> > ERROR: 02000: SELECT list is empty after excluding all columns
> >
> > My paper proposes that this should be an error because foo is ambiguous.
>
> Consider this example:
>
> create table t1(id int, data text, more_data text);
> create table t2(id int, other_data text, different_data text);
>
> Now if you wanted just the data without the surrogate keys, you would
> want to say:
>
> select * exclude (id) from t1 join t2 on t1.id = t2.id;
>
> Having to specify (t1.id, t2.id) would make it cumbersome to use,
> especially considering "exclude" would mostly be useful for
> interactive use.
>
A slightly different but perhaps more compelling version of this would be:
select * exclude (id) from t1 join t2 using (id);
Without the exclude, the returned row would only have a single id
column, so it seems pretty natural to similarly add an exclude for
that single id column.
Robert Treat
https://xzilla.net
view thread (3+ messages)
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], [email protected]
Subject: Re: Proposal: SELECT * EXCLUDE (...) command
In-Reply-To: <CABV9wwPVNJJSOnFZhTfAVrotzNXTmKg8H9gyvY+_V9uqw5mhMw@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