Re: multiple inserts

From: Liam Stewart <liams(at)redhat(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: multiple inserts
Date: 2001-09-07 14:54:18
Message-ID: 20010907105418.A9712@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)redhat(dot)com

Attachment Content-Type Size
insert.patch text/plain 12.5 KB
insert.out text/plain 3.0 KB
insert.sql text/plain 1.8 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2001-09-07 15:17:35 Re: Support building in a different directory on Solaris
Previous Message Jeroen van Vianen 2001-09-07 14:45:57 Re: [HACKERS] JDBC pg_description update needed for CVS