Allow some exclusion constraints on partitions
Peter Eisentraut <peter@eisentraut.org>
Allow some exclusion constraints on partitions Previously we only allowed unique B-tree constraints on partitions (and only if the constraint included all the partition keys). But we could allow exclusion constraints with the same restriction. We also require that those columns be compared for equality, not something like &&. Author: Paul A. Jungwirth <pj@illuminatedcomputing.com> Reviewed-by: Ronan Dunklau <ronan.dunklau@aiven.io> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://www.postgresql.org/message-id/flat/ec8b1d9b-502e-d1f8-e909-1bf9dffe6fa5@illuminatedcomputing.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/btree_gist/expected/partitions.out | added | +82 −0 |
| contrib/btree_gist/Makefile | modified | +1 −1 |
| contrib/btree_gist/meson.build | modified | +1 −0 |
| contrib/btree_gist/sql/partitions.sql | added | +39 −0 |
| doc/src/sgml/ddl.sgml | modified | +7 −5 |
| src/backend/commands/indexcmds.c | modified | +38 −21 |
| src/backend/parser/parse_utilcmd.c | modified | +0 −6 |
| src/test/regress/expected/alter_table.out | modified | +1 −6 |
| src/test/regress/expected/create_table.out | modified | +0 −8 |
| src/test/regress/expected/indexing.out | modified | +62 −11 |
| src/test/regress/sql/alter_table.sql | modified | +1 −4 |
| src/test/regress/sql/create_table.sql | modified | +0 −6 |
| src/test/regress/sql/indexing.sql | modified | +52 −5 |
Documentation touched
Discussion
- Exclusion constraints on partitioned tables 12 messages · 2022-12-15 → 2023-07-12