From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: mikemjv@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15425: DETACH/ATTACH PARTITION bug
Date: Wed, 10 Oct 2018 13:47:28 -0300
Message-ID: <20181010164728.ymzfjw6loxj6flx6@alvherre.pgsql> (raw)
In-Reply-To: <15425-2dbc9d2aa999f816@postgresql.org>
On 2018-Oct-10, PG Bug reporting form wrote:
> After I DETACH a partition, and then try to ATTACH it again, I get errors:
> ERROR: duplicate key value violates unique constraint
> "pg_constraint_conrelid_contypid_conname_index"
> DETAIL: Key (conrelid, contypid, conname)=(26702, 0,
> test_result_asset_id_fkey) already exists.
>
> It looks like it is trying to add the foreign key again.
Thanks. Reproduced with
create table main (a int primary key);
create table part (a int references main) partition by range (a);
create table part1 partition of part for values from (1) to (100);
alter table part detach partition part1;
alter table part attach partition part1 for values from (1) to (100);
Looking into it.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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: alvherre@2ndquadrant.com, mikemjv@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15425: DETACH/ATTACH PARTITION bug
In-Reply-To: <20181010164728.ymzfjw6loxj6flx6@alvherre.pgsql>
* 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