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/nodes/outfuncs.c | |
parent | b865d2758255b767e30dc5f23c7c7d209e716f3b (diff) | |
download | postgresql-8a5849b7ff24c637a1140c26fc171e45c9142005.tar.gz |
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/nodes/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 79665ed12a..a776f9fe3e 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.366 2009/10/08 02:39:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.367 2009/10/10 01:43:49 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -242,6 +242,7 @@ _outPlannedStmt(StringInfo str, PlannedStmt *node) WRITE_NODE_TYPE("PLANNEDSTMT"); WRITE_ENUM_FIELD(commandType, CmdType); + WRITE_BOOL_FIELD(hasReturning); WRITE_BOOL_FIELD(canSetTag); WRITE_NODE_FIELD(planTree); WRITE_NODE_FIELD(rtable); @@ -250,7 +251,6 @@ _outPlannedStmt(StringInfo str, PlannedStmt *node) WRITE_NODE_FIELD(intoClause); WRITE_NODE_FIELD(subplans); WRITE_BITMAPSET_FIELD(rewindPlanIDs); - WRITE_NODE_FIELD(returningLists); WRITE_NODE_FIELD(rowMarks); WRITE_NODE_FIELD(relationOids); WRITE_NODE_FIELD(invalItems); @@ -319,6 +319,19 @@ _outResult(StringInfo str, Result *node) } static void +_outModifyTable(StringInfo str, ModifyTable *node) +{ + WRITE_NODE_TYPE("MODIFYTABLE"); + + _outPlanInfo(str, (Plan *) node); + + WRITE_ENUM_FIELD(operation, CmdType); + WRITE_NODE_FIELD(resultRelations); + WRITE_NODE_FIELD(plans); + WRITE_NODE_FIELD(returningLists); +} + +static void _outAppend(StringInfo str, Append *node) { WRITE_NODE_TYPE("APPEND"); @@ -326,7 +339,6 @@ _outAppend(StringInfo str, Append *node) _outPlanInfo(str, (Plan *) node); WRITE_NODE_FIELD(appendplans); - WRITE_BOOL_FIELD(isTarget); } static void @@ -1501,7 +1513,6 @@ _outPlannerInfo(StringInfo str, PlannerInfo *node) WRITE_UINT_FIELD(query_level); WRITE_NODE_FIELD(join_rel_list); WRITE_NODE_FIELD(resultRelations); - WRITE_NODE_FIELD(returningLists); WRITE_NODE_FIELD(init_plans); WRITE_NODE_FIELD(cte_plan_ids); WRITE_NODE_FIELD(eq_classes); @@ -2408,6 +2419,9 @@ _outNode(StringInfo str, void *obj) case T_Result: _outResult(str, obj); break; + case T_ModifyTable: + _outModifyTable(str, obj); + break; case T_Append: _outAppend(str, obj); break; |