mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Fix RETURNING to work correctly with partition tuple routing.
In ExecInsert(), do not switch back to the root partitioned table ResultRelInfo until after we finish ExecProcessReturning(), so that RETURNING projection is done using the partition's descriptor. For the projection to work correctly, we must initialize the same for each leaf partition during ModifyTableState initialization. Amit Langote
This commit is contained in:
@ -13454,6 +13454,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd)
|
||||
constr = linitial(partConstraint);
|
||||
my_constr = make_ands_implicit((Expr *) constr);
|
||||
tab->partition_constraint = map_partition_varattnos(my_constr,
|
||||
1,
|
||||
part_rel,
|
||||
rel);
|
||||
/* keep our lock until commit */
|
||||
|
Reference in New Issue
Block a user