Re: pgsql: Allow UNIQUE indexes on partitioned tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pgsql: Allow UNIQUE indexes on partitioned tables
Date
Msg-id 20180312163415.6s3enkeetf5cbkot@alvherre.pgsql
Whole thread Raw
In response to Re: pgsql: Allow UNIQUE indexes on partitioned tables  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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


pgsql-hackers by date:

Previous
From: Narendra Pradeep U U
Date:
Subject: Ambigous Plan - Larger Table on Hash Side
Next
From: Tom Lane
Date:
Subject: Re: Cast jsonb to numeric, int, float, bool