Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT

Jesper Pedersen <jesper.pedersen@redhat.com>

From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2019-01-15T19:45:03Z
Lists: pgsql-bugs
Hi,

On 1/15/19 2:35 PM, Alvaro Herrera wrote:
> On 2019-Jan-15, Tom Lane wrote:
>> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>>> I haven't investigated this angle.  It seems more complex than just a
>>> simple bugfix, right?
>>
>> Wouldn't that be throwing away the entire point of the ONLY behavior,
>> ie to allow the component indexes to be built one at a time, without
>> holding locks across the whole partition tree?
> 
> I now see that Jesper was talking about a completely different thing
> than I was thinking.  I agree with you there -- it makes no sense to
> reject that command ... particularly because pg_dump uses it.
> 

I now think Tom is correct that it is UX and documentation issue, and 
changing the existing behavior is probably not a good thing.

Changing "invalid" to "incomplete" would be a good idea. Maybe "partial" 
could be a good descriptor if not all partitions shares the unique 
constraint.

Best regards,
  Jesper


Commits

  1. Fix creation of duplicate foreign keys on partitions