-
- Downloads
Fix tuple routing in cases where tuple descriptors don't match.
The previous coding failed to work correctly when we have a multi-level partitioned hierarchy where tables at successive levels have different attribute numbers for the partition key attributes. To fix, have each PartitionDispatch object store a standalone TupleTableSlot initialized with the TupleDesc of the corresponding partitioned table, along with a TupleConversionMap to map tuples from the its parent's rowtype to own rowtype. After tuple routing chooses a leaf partition, we must use the leaf partition's tuple descriptor, not the root table's. To that end, a dedicated TupleTableSlot for tuple routing is now allocated in EState. Amit Langote
Showing
- src/backend/catalog/partition.c 61 additions, 13 deletionssrc/backend/catalog/partition.c
- src/backend/commands/copy.c 29 additions, 2 deletionssrc/backend/commands/copy.c
- src/backend/executor/nodeModifyTable.c 27 additions, 0 deletionssrc/backend/executor/nodeModifyTable.c
- src/include/catalog/partition.h 7 additions, 0 deletionssrc/include/catalog/partition.h
- src/include/nodes/execnodes.h 3 additions, 0 deletionssrc/include/nodes/execnodes.h
- src/test/regress/expected/insert.out 37 additions, 0 deletionssrc/test/regress/expected/insert.out
- src/test/regress/sql/insert.sql 26 additions, 0 deletionssrc/test/regress/sql/insert.sql
Loading
Please register or sign in to comment