Re: Query related to alter table ... attach partition

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Query related to alter table ... attach partition
Date: 2018-01-29 07:25:49
Message-ID: CAFjFpRcxJo1+t8qeLsQ-KG+f7mt0HEQDLx=CyOpAQzm9R6fJJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 23, 2018 at 12:25 PM, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-01-29 07:28:54 Re: unique indexes on partitioned tables
Previous Message Nikhil Sontakke 2018-01-29 07:15:04 Re: Logical Decoding and HeapTupleSatisfiesVacuum assumptions