A partition boundary defines the value limits accepted by a table partition. In PostgreSQL, declarative partitioning combines a partitioning method, one or more partition keys, and these boundaries. Boundaries determine placement, pruning, and whether newly declared partitions overlap. section 4.2 section 4.3
The misleading branch-range partition
Suppose an energy-usage table uses RANGE (reading_time, branch_id). A January partition declared FROM ('2024-01-01', 1) TO ('2024-02-01', 10) already covers reading_time values through January 31 for a range of branch_id values. Declaring a second January partition FROM ('2024-01-01', 11) TO ('2024-02-01', 20) fails because PostgreSQL detects overlapping multidimensional bounds. A composite boundary is not two independent filters and does not create month-then-branch levels. section 4.3
Use sub-partitioning when the intended structure is one partition per month, with branch partitions inside each month. Define the parent with RANGE (reading_time), make each monthly partition partitioned by branch_id, and then declare branch bounds beneath it.
Keep these boundary rules in mind:
- Treat multidimensional RANGE bounds as a combined boundary, not as independent ranges for each key. section 4.3
