Skip site navigation (1) Skip section navigation (2)

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

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Eric Ridge <eebbrr(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Date: 2011-10-29 22:35:47
Message-ID: 20111029223547.GM24234@tamriel.snowman.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Eric,

* Eric Ridge (eebbrr(at)gmail(dot)com) wrote:
> 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.

Well, I expect most here would say that any application query should be
specific about exactly what columns it wants (iow- don't use select * in
your apps :).  As for it being useful in psql, I could see that.

> 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?

I don't know of anything like this in the spec.  Also, there would be
concern about this possibly going against spec, breaking possibly valid
queries, promoting keywords to reserved words, and maybe ending up in a
bad situation if the SQL committee decides to support that kind of
syntax for something completely different.

In general, I doubt this is something we'd implement, but others may
feel differently.  What might be interesting to consider is how hard it
would be to make psql smarter when it comes to line editing in this
regard.  Maybe if there was a way to easily expand the '*' from psql and
then you could remove the columns from the list easily..?

	Thanks,

		Stephen

In response to

Responses

pgsql-hackers by date

Next:From: Eric RidgeDate: 2011-10-29 22:53:50
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Previous:From: Eric RidgeDate: 2011-10-29 22:26:19
Subject: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group