Re: Query related to alter table ... attach partition - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Query related to alter table ... attach partition
Date
Msg-id CAFjFpRcxJo1+t8qeLsQ-KG+f7mt0HEQDLx=CyOpAQzm9R6fJJQ@mail.gmail.com
Whole thread Raw
In response to Re: Query related to alter table ... attach partition  (Ashutosh Sharma <ashu.coek88@gmail.com>)
List pgsql-hackers
On Tue, Jan 23, 2018 at 12:25 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>>
>
> That's right. But, shouldn't a partition that not at all fall in the
> partition range be rejected when user tries to attach it. I feel we
> should at least try throwing a WARNING message for it. Thoughts?
>

One can add constraints contradicting the partition constraints after
the table is attached as partition. Moreover, one can add multiple
constraints over the time that together contradict partition
constraints. I don't think it's worth the effort to make sure that all
constraints taken together contradict partition constraints or not.
The downside is simply that the partition will remain empty forever,
but then that's what user wants, since s/he has added the constraints.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


pgsql-hackers by date:

Previous
From: Nikhil Sontakke
Date:
Subject: Re: Logical Decoding and HeapTupleSatisfiesVacuum assumptions
Next
From: Amit Langote
Date:
Subject: Re: unique indexes on partitioned tables