Re: [PATCHES] 8.2 features? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] 8.2 features?
Date
Msg-id 23454.1153370214@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] 8.2 features?  (Joe Conway <mail@joeconway.com>)
Responses Re: [PATCHES] 8.2 features?  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> The difficulty is finding a way to avoid all that extra work without a 
> very ugly special case kludge just for inserts.

[ thinks a bit ... ]

It seems to me that the reason it's painful is exactly that INSERT
... VALUES is a kluge already.  We've special-cased the situation where
the INSERT's <query expression> is a <table value constructor> with
exactly one row --- but actually a <table value constructor> with
multiple rows ought to be allowed anywhere you can currently write
"SELECT ...".  So ideally fixing this would include eliminating the
current artificial distinction between two types of INSERT command.

I think the place we'd ultimately like to get to involves changing the
executor's Result node type to have a list of targetlists and sequence
through those lists to produce its results (cf Append --- perhaps while
at it, divorce the "gating node" functionality into a different node
type).  That part seems clear, what's a bit less clear is what the
ripple effect on the upstream parser/planner data structures should be.
Should *all* occurrences of Query be changed to have a
list-of-targetlists?  Sounds ugly, and I don't understand what it would
mean for any Query other than one representing a VALUES construct.

[ thinks some more ... ]

Maybe the right place to put the list-of-targetlists functionality is
not in Query per se, but in a new type of jointree node.  This would
localize the impact as far as changing the datastructures go, but I've
not thought hard enough about what the impact would actually be.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: [PATCHES] 8.2 features?
Next
From: Mark Kirkwood
Date:
Subject: Re: Statement Queuing