aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
-rw-r--r--src/backend/executor/nodeModifyTable.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index f62d28ac608..299c2c75be8 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -3966,10 +3966,10 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
* must be converted, and
* - the root partitioned table used for tuple routing.
*
- * If it's a partitioned table, the root partition doesn't appear
- * elsewhere in the plan and its RT index is given explicitly in
- * node->rootRelation. Otherwise (i.e. table inheritance) the target
- * relation is the first relation in the node->resultRelations list.
+ * If it's a partitioned or inherited table, the root partition or
+ * appendrel RTE doesn't appear elsewhere in the plan and its RT index is
+ * given explicitly in node->rootRelation. Otherwise, the target relation
+ * is the sole relation in the node->resultRelations list.
*----------
*/
if (node->rootRelation > 0)
@@ -3980,6 +3980,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
}
else
{
+ Assert(list_length(node->resultRelations) == 1);
mtstate->rootResultRelInfo = mtstate->resultRelInfo;
ExecInitResultRelation(estate, mtstate->resultRelInfo,
linitial_int(node->resultRelations));