Re: pgsql: Allow UNIQUE indexes on partitioned tables
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-03-12T16:34:15Z
Lists: pgsql-hackers
David G. Johnston wrote: > Something like: > > When establishing a unique constraint for a multi-level partition hierarchy > all the "partition by" columns of the target partitioned table, as well as > those of all its descendant partitioned tables, must be included in the > constraint definition. Yeah, that seems better to me. Pushed. > If I understand the above then the following failing test would be a worthy > addition to memorialize the behavior of ALTER TABLE ATTACH under this > constraint. > > create table idxpart (a int primary key, b int) partition by range (a); > create table idxpart1 (a int not null, b int, primary key (a, b)) partition > by range (a, b); > alter table idxpart attach partition idxpart1 for values from (1) to (1000); Included this one too. Thanks for reading! -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
doc: move PARTITION OF stanza to just below PARTITION BY
- 07f303ab6076 11.0 landed
- c6736ff76046 12.0 landed
-
doc: Reword restriction on partition keys in unique indexes
- 63cbee6a7860 11.0 landed
-
Adjust ALTER TABLE docs on partitioned constraints
- 9a89f6d85467 11.0 landed
-
Allow UNIQUE indexes on partitioned tables
- eb7ed3f30634 11.0 cited