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/tcop/pquery.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/tcop/pquery.c')
-rw-r--r-- | src/backend/tcop/pquery.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index 98716830cd..f07bb49b53 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.131 2009/06/11 14:49:02 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.132 2009/10/10 01:43:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -338,7 +338,7 @@ ChoosePortalStrategy(List *stmts) { if (++nSetTag > 1) return PORTAL_MULTI_QUERY; /* no need to look further */ - if (pstmt->returningLists == NIL) + if (!pstmt->hasReturning) return PORTAL_MULTI_QUERY; /* no need to look further */ } } @@ -414,8 +414,8 @@ FetchStatementTargetList(Node *stmt) pstmt->utilityStmt == NULL && pstmt->intoClause == NULL) return pstmt->planTree->targetlist; - if (pstmt->returningLists) - return (List *) linitial(pstmt->returningLists); + if (pstmt->hasReturning) + return pstmt->planTree->targetlist; return NIL; } if (IsA(stmt, FetchStmt)) @@ -570,9 +570,9 @@ PortalStart(Portal portal, ParamListInfo params, Snapshot snapshot) pstmt = (PlannedStmt *) PortalGetPrimaryStmt(portal); Assert(IsA(pstmt, PlannedStmt)); - Assert(pstmt->returningLists); + Assert(pstmt->hasReturning); portal->tupDesc = - ExecCleanTypeFromTL((List *) linitial(pstmt->returningLists), + ExecCleanTypeFromTL(pstmt->planTree->targetlist, false); } |