summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/ruleutils.c11
-rw-r--r--src/backend/utils/cache/plancache.c6
2 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index d88d8f22f3..35c530bbda 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);
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
index 82f90a9312..6cd138b288 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -35,7 +35,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.28 2009/07/14 15:37:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.29 2009/10/10 01:43:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -880,8 +880,8 @@ PlanCacheComputeResultDesc(List *stmt_list)
if (IsA(node, PlannedStmt))
{
pstmt = (PlannedStmt *) node;
- Assert(pstmt->returningLists);
- return ExecCleanTypeFromTL((List *) linitial(pstmt->returningLists), false);
+ Assert(pstmt->hasReturning);
+ return ExecCleanTypeFromTL(pstmt->planTree->targetlist, false);
}
/* other cases shouldn't happen, but return NULL */
break;