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

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

From: Eric Ridge <eebbrr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Darren Duncan <darren(at)darrenduncan(dot)net>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Date: 2011-10-30 20:27:51
Message-ID: CANcm6wbZaicLqKqo1S9CQtF0fMEvN7nYY+04u-oCtA_x3SUwHw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sun, Oct 30, 2011 at 4:03 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> That's just a gut feeling, I've not tried it ... but the proposed
> syntax sure looks a lot like a call to a function named EXCLUDING.

I think what makes it okay is that its new use is only defined to
immediately follow an asterisk in the "target_el" production.  If you
look at gram.y:11578 (from git HEAD), I was thinking this:
                        | a_expr
                                {
                                        $$ = makeNode(ResTarget);
                                        $$->name = NULL;
                                        $$->indirection = NIL;
                                        $$->val = (Node *)$1;
                                        $$->location = @1;
                                }
+                        | '*' EXCLUDING '(' columnref_list ')'
+                                {
+                                        /** make magic happen */
+                                }
                        | '*'
                                {
                                        ColumnRef *n = makeNode(ColumnRef);
                                        n->fields =
list_make1(makeNode(A_Star));
                                        n->location = @1;

                                        $$ = makeNode(ResTarget);
                                        $$->name = NULL;
                                        $$->indirection = NIL;
                                        $$->val = (Node *)n;
                                        $$->location = @1;
                                }

And it looks like something similar would be necessary in the
"indirection_el" production, around line 11478.  But that might be
overly simplistic (and wrong).

eric

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2011-10-30 20:43:25
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Previous:From: Tom LaneDate: 2011-10-30 20:09:04
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?

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