pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
Date: Thu, 10 Jan 2019 12:43:11 -0500
Message-ID: <3e406e7f-b3df-7f9d-fcf3-1201f3c87903@redhat.com> (raw)
In-Reply-To: <201901101711.ngskkvwyqgr6@alvherre.pgsql>
References: <201901101711.ngskkvwyqgr6@alvherre.pgsql>

Hi,

On 1/10/19 12:11 PM, Alvaro Herrera wrote:
> On 2019-Jan-10, PG Bug reporting form wrote:
>> Removing ONLY from the ALTER command makes the index correct.
> 
> I'm not clear what problem you're reporting.  If you use ONLY, then the
> command doesn't cascade to create the index on partitions, and the index
> is marked invalid.  If you add the constraint to each partition and
> ALTER INDEX ATTACH PARTITION, the index on t1 should become valid when
> every partition of the table has its index.
> 

However, when you use ADD CONSTRAINT FOREIGN KEY you can't use ONLY, so 
would it be a good idea to make ADD CONSTRAINT UNIQUE behave the same 
way, i.e. error out ?

Best regards,
  Jesper




view thread (18+ messages)  latest in thread

Message-ID: <3e406e7f-b3df-7f9d-fcf3-1201f3c87903@redhat.com>
Permalink:  ../3e406e7f-b3df-7f9d-fcf3-1201f3c87903@redhat.com/
Also on:    postgresql.org/message-id/3e406e7f-b3df-7f9d-fcf3-1201f3c87903@redhat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: jesper.pedersen@redhat.com, alvherre@2ndquadrant.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
  In-Reply-To: <3e406e7f-b3df-7f9d-fcf3-1201f3c87903@redhat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox