From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Subject: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error
Date: Mon, 15 Jul 2024 10:00:01 +0000
Message-ID: <18541-628a61bc267cd2d3@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18541
Logged by: Alexander Lakhin
Email address: exclusion@gmail.com
PostgreSQL version: 17beta2
Operating system: Ubuntu 22.04
Description:
The following script:
CREATE TABLE t1 (a int, PRIMARY KEY (a));
CREATE TABLE t (a int, PRIMARY KEY (a), FOREIGN KEY (a) REFERENCES t1)
PARTITION BY LIST (a);
ALTER TABLE t ATTACH PARTITION t1 FOR VALUES IN (1);
ALTER TABLE t DETACH PARTITION t1;
ALTER TABLE t ATTACH PARTITION t1 FOR VALUES IN (1);
ends up with the error complaining about check triggers:
ERROR: XX000: could not find ON INSERT check triggers of foreign key
constraint 16400
LOCATION: GetForeignKeyCheckTriggers, tablecmds.c:11260
Reproduced on REL_15_STABLE (starting from f4566345c) .. master.
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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, exclusion@gmail.com
Subject: Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error
In-Reply-To: <18541-628a61bc267cd2d3@postgresql.org>
* 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