Re: RFC: Inserting multiple values via INSERT ... VALUES ... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: RFC: Inserting multiple values via INSERT ... VALUES ...
Date
Msg-id 19340.997810750@sss.pgh.pa.us
Whole thread Raw
In response to RFC: Inserting multiple values via INSERT ... VALUES ...  (Liam Stewart <liams@redhat.com>)
List pgsql-hackers
Liam Stewart <liams@redhat.com> writes:
> While it
> should be possible to modify the Result node to handle multiple
> tuples, I would rather not use Result as Result is also used for
> constant qualifications.

If you don't want to extend Result, I'd suggest generating a plan that
is an Append of Result nodes.  There's no need to add a new node type.

Personally I wouldn't have a problem with allowing Result to handle
a list of targetlists, though.  It's already capable of returning
multiple rows (when there's a function-returning-set in the targetlist)
so I don't find multiple targetlists to be that much of an uglification.

> Also, at some point, it would be nice to put together a new statement
> node type that represents the SQL <query expression>. This node would
> be used everywhere that a <query expression> could be used, hiding
> the complexity of having to deal with either a SELECT statement or a
> VALUES clause. For example, the parser rule for INSERT statements
> would be simplified as well as the transformInsertStmt function.

The present handling of INSERT/SELECT is really really ugly.  The whole
querytree structure desperately needs to be rethought, actually.  You
can find some theorizing about what to do in the mail list archives,
but we're still far from having a detailed plan.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: To be 7.1.3 or not to be 7.1.3?
Next
From: Ddkilzer
Date:
Subject: Fwd: PostgreSQL Bugzilla