mirror of
https://github.com/postgres/postgres.git
synced 2025-10-22 14:32:25 +03:00
Allow UNIQUE indexes on partitioned tables
If we restrict unique constraints on partitioned tables so that they must always include the partition key, then our standard approach to unique indexes already works --- each unique key is forced to exist within a single partition, so enforcing the unique restriction in each index individually is enough to have it enforced globally. Therefore we can implement unique indexes on partitions by simply removing a few restrictions (and adding others.) Discussion: https://postgr.es/m/20171222212921.hi6hg6pem2w2t36z@alvherre.pgsql Discussion: https://postgr.es/m/20171229230607.3iib6b62fn3uaf47@alvherre.pgsql Reviewed-by: Simon Riggs, Jesper Pedersen, Peter Eisentraut, Jaime Casanova, Amit Langote
This commit is contained in:
@@ -26,6 +26,7 @@ extern ObjectAddress DefineIndex(Oid relationId,
|
||||
IndexStmt *stmt,
|
||||
Oid indexRelationId,
|
||||
Oid parentIndexId,
|
||||
Oid parentConstraintId,
|
||||
bool is_alter_table,
|
||||
bool check_rights,
|
||||
bool check_not_in_use,
|
||||
|
Reference in New Issue
Block a user