diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-10 01:43:50 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-10 01:43:50 +0000 |
commit | 8a5849b7ff24c637a1140c26fc171e45c9142005 (patch) | |
tree | 8f660c08709c999c3a4299436312390c53231b01 /src/backend/utils/adt/ruleutils.c | |
parent | b865d2758255b767e30dc5f23c7c7d209e716f3b (diff) | |
download | postgresql-8a5849b7ff24c637a1140c26fc171e45c9142005.tar.gz postgresql-8a5849b7ff24c637a1140c26fc171e45c9142005.zip |
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
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index d88d8f22f32..35c530bbdac 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -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); |