aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execPartition.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/execPartition.c')
-rw-r--r--src/backend/executor/execPartition.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index 33d2c6f63de..08f91e59a7a 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -908,6 +908,15 @@ ExecInitPartitionInfo(ModifyTableState *mtstate, EState *estate,
}
/*
+ * Also, if transition capture is required, store a map to convert tuples
+ * from partition's rowtype to the root partition table's.
+ */
+ if (mtstate->mt_transition_capture || mtstate->mt_oc_transition_capture)
+ leaf_part_rri->ri_ChildToRootMap =
+ convert_tuples_by_name(RelationGetDescr(leaf_part_rri->ri_RelationDesc),
+ RelationGetDescr(leaf_part_rri->ri_PartitionRoot));
+
+ /*
* Since we've just initialized this ResultRelInfo, it's not in any list
* attached to the estate as yet. Add it, so that it can be found later.
*
@@ -977,20 +986,6 @@ ExecInitRoutingInfo(ModifyTableState *mtstate,
partrouteinfo->pi_PartitionTupleSlot = NULL;
/*
- * Also, if transition capture is required, store a map to convert tuples
- * from partition's rowtype to the root partition table's.
- */
- if (mtstate &&
- (mtstate->mt_transition_capture || mtstate->mt_oc_transition_capture))
- {
- partrouteinfo->pi_PartitionToRootMap =
- convert_tuples_by_name(RelationGetDescr(partRelInfo->ri_RelationDesc),
- RelationGetDescr(partRelInfo->ri_PartitionRoot));
- }
- else
- partrouteinfo->pi_PartitionToRootMap = NULL;
-
- /*
* If the partition is a foreign table, let the FDW init itself for
* routing tuples to the partition.
*/