1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Split the processing of INSERT/UPDATE/DELETE operations out of execMain.c.

They are now handled by a new plan node type called ModifyTable, which is
placed at the top of the plan tree.  In itself this change doesn't do much,
except perhaps make the handling of RETURNING lists and inherited UPDATEs a
tad less klugy.  But it is necessary preparation for the intended extension of
allowing RETURNING queries inside WITH.

Marko Tiikkaja
This commit is contained in:
Tom Lane
2009-10-10 01:43:50 +00:00
parent b865d27582
commit 8a5849b7ff
30 changed files with 1546 additions and 1101 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.308 2009/10/09 21:02:55 petere Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.309 2009/10/10 01:43:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -3346,11 +3346,12 @@ static void
push_plan(deparse_namespace *dpns, Plan *subplan)
{
/*
* We special-case Append to pretend that the first child plan is the
* OUTER referent; otherwise normal.
* We special-case ModifyTable to pretend that the first child plan is the
* OUTER referent; otherwise normal. This is to support RETURNING lists
* containing references to non-target relations.
*/
if (IsA(subplan, Append))
dpns->outer_plan = (Plan *) linitial(((Append *) subplan)->appendplans);
if (IsA(subplan, ModifyTable))
dpns->outer_plan = (Plan *) linitial(((ModifyTable *) subplan)->plans);
else
dpns->outer_plan = outerPlan(subplan);