Re: multiple inserts - Mailing list pgsql-patches

From Liam Stewart
Subject Re: multiple inserts
Date
Msg-id 20010907105418.A9712@redhat.com
Whole thread Raw
In response to Re: multiple inserts  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: multiple inserts  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
I'm in agreement about postponing the targetList changes; I don't like
the third attempt and knew before I started that the patch would be ugly
and would leave many things dangling.

But following up on Tom's latest suggestion, I've implemented it in the
yacc grammer rather than in the parser. I prefer this method as there is
less to change in analyze.c and it seems safer - having the parser
construct something more or less automatically and then re-using
existing functionality rather than having to build up Queries and SetOp
trees by hand (can't really use existing methods). The patch is short
actually simplifies things a bit as the targetlist field of InsertStmt
is no longer needed.

The only problem that I've encountered is that the rules regression test
is failing on the last select statement - the rule definitions are
displayed using SELECTs rather than VALUES. They are equivalent, but is
that re-writing alright? Looking at get_insert_query_def() in
ruleutils.c, it seems that this change is unavoidable if INSERT ...
VALUES are rewritten (any way) as INSERT ... SELECT, in which case
either the implementation on the patch needs to be reconsidered or the
regression test expected output needs to be modified.

Liam

--
Liam Stewart :: Red Hat Canada, Ltd. :: liams@redhat.com

Attachment

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: JDBC patch procedures (Re: Patch for jdbc2 ResultSet.java)
Next
From: Peter Eisentraut
Date:
Subject: Re: Support building in a different directory on Solaris