Re: Declarative partitioning - another take
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
On 2017/01/31 6:42, Peter Eisentraut wrote: > On 1/25/17 12:54 AM, Ashutosh Bapat wrote: >> The documentation available at >> https://www.postgresql.org/docs/devel/static/sql-createtable.html, >> does not make it clear that the lower bound of a range partition is >> always inclusive and the higher one is exclusive. I think a note in >> section " PARTITION OF parent_table FOR VALUES partition_bound_spec" >> would be helpful. > > Hmm. I see the practical use of that, but I think this is going to be a > source of endless confusion. Can we make that a bit clearer in the > syntax, for example by using additional keywords (INCLUSIVE/EXCLUSIVE)? The decision not to make that configurable with INCLUSIVE/EXCLUSIVE syntax was deliberate. To summarize, we can start with a default configuration catering to most practical cases (that is, inclusive lower and exclusive upper bounds) and documenting so (not done yet, which I will post a doc patch today for). If it turns out that there is some demand for making that configurable, we can later add the code to handle that internally plus the syntax. But *starting* with that syntax means we have to potentially needlessly carry the code to handle seldom used cases that could not be made as efficient as it is now with all lower bounds being inclusive and upper bounds exclusive. Thanks, Amit [1] https://www.postgresql.org/message-id/CA%2BTgmoZou4ApEvC_nfhOxsi5G4SoD_evwNaiYn60ZcJ4XB_-QQ%40mail.gmail.com
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