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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Darren Duncan <darren(at)darrenduncan(dot)net>
Cc: Eric Ridge <eebbrr(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Date: 2011-10-30 03:37:49
Message-ID: CAFj8pRAk14KEeSVrQUCGBhe4hiq=RDvt2yRqWGi4ZtrFLiJPCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/10/30 Darren Duncan <darren(at)darrenduncan(dot)net>:
> I agree that this feature would be quite useful and should be included in
> SQL. The exact syntax is less of an issue, but just the ability to cleanly
> say "select all columns except for these".  I have in fact argued for the
> same feature in the past.
>
> If you want to and can implement this feature then more power to you.  I'll
> look forward to it being in Pg 9.2.
>
> I think then the only discussion point should be what (terse) syntax to use
> for it, not whether the feature should exist at all.
>
> Arguing against this feature is like arguing against supporting "where
> not()" or "except" or "not in".  One should be able to do complements not
> only of rows but of columns too.  Basic good language design.

My practice speaks so this is not true - I don't know only bad
designed projects or very bad designed projects that needs too.

I don't see any reason why do it on SQL level.

It can sence only in psql as same special filter - if we would to
enhace a report features there.

Regards

Pavel Stehule

>
> -- Darren Duncan
>
> Eric Ridge 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!
>>
>> eric
>>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2011-10-30 04:53:55 Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Previous Message Shigeru Hanada 2011-10-30 02:34:06 Re: pgsql_fdw, FDW for PostgreSQL server