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

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Eric Ridge <eebbrr(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Date: 2011-11-01 13:16:23
Message-ID: CAHyXU0wik_Ve_bEvnDuhT4bgwR-4C8mKuSfEd8-HivsvQSyGeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Oct 29, 2011 at 5:26 PM, Eric Ridge <eebbrr(at)gmail(dot)com> wrote:
> Would y'all accept a patch that extended the "SELECT *" syntax to let
> you list fields to exclude from the A_Star?
>
> Quite regularly I'll be testing queries via psql and want to see all
> the columns from a fairly wide table except maybe a giant text or xml
> column.  A syntax like:
>
>     SELECT * EXCLUDING (big_col1, big_col2) FROM foo;
>
> would be pretty handy.  It would definitely save some typing in
> certain cases.  It seems like such a syntax would better document the
> intent of a query too, rather than leaving one wondering if "big_col1"
> was supposed to be omitted from the target list or not.
>
> Anyways, I just wanted to run the idea by youse guys before I put too
> much more effort into it.  I've already made what appear to be the
> minimum necessary changes to gram.y, and a few quick greps through the
> code make me think the rest will be pretty easy.
>
> Maybe the SQL spec says something about this and nobody's done the work yet?
>
> Thanks for your input!

FWIW, this seems to come up all the time for me and I've often
wondered about something like this. Just be advised that the bar for
syntax extensions is very high because they can burn you down the line
quite easily.

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-11-01 13:23:36 Re: unite recovery.conf and postgresql.conf
Previous Message Simon Riggs 2011-11-01 13:03:18 Re: IDLE in transaction introspection