Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?

From: Eric Ridge <eebbrr(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Marti Raudsepp <marti(at)juffo(dot)org>, Marcin Mańk <marcin(dot)mank(at)gmail(dot)com>, Mark Mielke <mark(at)mark(dot)mielke(dot)cc>, Darren Duncan <darren(at)darrenduncan(dot)net>, David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Date: 2011-11-01 16:51:46
Message-ID: CANcm6wb_5+PU7ggJpc56CLiewys47Kwxvu0kxNyNg2pBu8O6XA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 1, 2011 at 12:03 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
>  Note- I haven't looked at the * production or tried to do anything w/ gram.y to
> support this yet, but it's a heck of a lot shorter..

My original thought, that I probably didn't explain too clearly, was
to make the "EXCLUDING (...)" bit a modifier to the A_Star node. The
idea being that you could write "* EXCLUDING (...)" anywhere you can
currently write "*".

It's dead simple for the case of:
SELECT * FROM ...
but because of the "indirection" productions in gram.y, it's literally
impossible for:
SELECT tablename.* FROM ...
without possibly breaking existing queries.

Nonetheless, even if it were only available for the first form, it
would be very useful. For the ad-hoc type stuff I do, it'd still be
great to write:
SELECT * EXCLUDING (x.a, x.b, x.c) FROM (SELECT .... x);

I've already got gram.y working the way it needs to, and I've started
to get the exclusion list passed into the places it needs to go.

If y'all would be willing to accept it in this "limited" form, I'll
continue to work on it.

eric

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Eric Ridge 2011-11-01 16:58:10 Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Previous Message Pavel Stehule 2011-11-01 16:24:20 Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?