*** a/src/backend/executor/execMain.c --- b/src/backend/executor/execMain.c *************** *** 1884,1890 **** ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, char *val_desc; Relation orig_rel = rel; ! /* See the comment above. */ if (resultRelInfo->ri_PartitionRoot) { HeapTuple tuple = ExecFetchSlotTuple(slot); --- 1884,1893 ---- char *val_desc; Relation orig_rel = rel; ! /* ! * If the tuple has been routed, convert it from the partition's ! * rowtype to the root table's. See the comment in ExecConstraints(). ! */ if (resultRelInfo->ri_PartitionRoot) { HeapTuple tuple = ExecFetchSlotTuple(slot); *************** *** 2011,2017 **** ExecConstraints(ResultRelInfo *resultRelInfo, char *val_desc; Relation orig_rel = rel; ! /* See the comment above. */ if (resultRelInfo->ri_PartitionRoot) { HeapTuple tuple = ExecFetchSlotTuple(slot); --- 2014,2023 ---- char *val_desc; Relation orig_rel = rel; ! /* ! * If the tuple has been routed, convert it from the partition's ! * rowtype to the root table's. See the comment above. ! */ if (resultRelInfo->ri_PartitionRoot) { HeapTuple tuple = ExecFetchSlotTuple(slot); *************** *** 2121,2127 **** ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, * USING policy. */ case WCO_VIEW_CHECK: ! /* See the comment in ExecConstraints(). */ if (resultRelInfo->ri_PartitionRoot) { HeapTuple tuple = ExecFetchSlotTuple(slot); --- 2127,2137 ---- * USING policy. */ case WCO_VIEW_CHECK: ! /* ! * If the tuple has been routed, convert it from the ! * partition's rowtype to the root table's. See the ! * comment in ExecConstraints(). ! */ if (resultRelInfo->ri_PartitionRoot) { HeapTuple tuple = ExecFetchSlotTuple(slot);