Re: Declarative partitioning - another take
Robert Haas <robertmhaas@gmail.com>
On Mon, Dec 26, 2016 at 5:46 AM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote: > On 2016/12/23 8:08, Robert Haas wrote: >> On Thu, Dec 22, 2016 at 3:35 AM, Amit Langote >> <Langote_Amit_f8@lab.ntt.co.jp> wrote: >>> While working on that, I discovered yet-another-bug having to do with the >>> tuple descriptor that's used as we route a tuple down a partition tree. If >>> attnums of given key attribute(s) are different on different levels, it >>> would be incorrect to use the original slot's (one passed by ExecInsert()) >>> tuple descriptor to inspect the original slot's heap tuple, as we go down >>> the tree. It might cause spurious "partition not found" at some level due >>> to looking at incorrect field in the input tuple because of using the >>> wrong tuple descriptor (root table's attnums not always same as other >>> partitioned tables in the tree). Patch 0001 fixes that including a test. >> >> I committed this, but I'm a bit uncomfortable with it: should the >> TupleTableSlot be part of the ModifyTableState rather than the EState? > > Done that way in 0001 of the attached patches. So, instead of making the > standalone partition_tuple_slot a field of EState (with the actual > TupleTableSlot in its tupleTable), it is now allocated within > ModifyTableState and CopyState, and released when ModifyTable node or > CopyFrom finishes, respectively. I dropped some comments from this and committed it. They were formatted in a way that wouldn't survive pgindent. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Fix typo.
- 03bf59676ea0 10.0 landed
-
Document trigger-firing behavior for inheritance/partitioning.
- e17628145ac3 10.0 landed
-
Fire per-statement triggers on partitioned tables.
- e180c8aa8caf 10.0 landed
-
Set ecxt_scantuple correctly for tuple routing.
- 132488bfee68 10.0 landed
-
Fix interaction of partitioned tables with BulkInsertState.
- b1ecb9b3fcfb 10.0 landed
-
Avoid core dump for empty prepared statement in an aborted transaction.
- ba61a04bc7fe 10.0 cited
-
Fix some problems in check_new_partition_bound().
- 8a8afe2f54c2 10.0 landed
-
Remove unnecessary arguments from partitioning functions.
- 18fc5192a631 10.0 cited
-
Fix reporting of constraint violations for table partitioning.
- f1b4c771ea74 10.0 cited
-
Fix tuple routing in cases where tuple descriptors don't match.
- 2ac3ef7a01df 10.0 cited
-
Invalid parent's relcache after CREATE TABLE .. PARTITION OF.
- 7cd0fd655d68 10.0 landed
-
Doc: improve documentation about inheritance.
- 162477a63d3c 10.0 cited