BUG #19420: Zombie FK exists after partition is detached.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: a(dot)chodkowska(at)gmail(dot)com
Subject: BUG #19420: Zombie FK exists after partition is detached.
Date: 2026-02-27 09:09:36
Message-ID: 19420-ec7f929dce3a7e14@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19420
Logged by: Agnieszka Chodkowska
Email address: a(dot)chodkowska(at)gmail(dot)com
PostgreSQL version: 16.6
Operating system: Linux, Debian 12.2.0 64 bit
Description:

I have child table with FK defined as folllows

ALTER TABLE IF EXISTS tst.child_test_1
ADD CONSTRAINT child_test_1_parent_id_parent_part_by_fkey FOREIGN KEY
(parent_id, parent_part_by)
REFERENCES tst.maintenance_test_1_p20260218 (id, part_by) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE;

I updated configuration according to documentation as follows:
retention_keep_table=false ,
retention_keep_index = false

Somehow postgresql retains the foreign keys of the detached/dropped
partitions, to the parent table partitions.

I try the following methods:
partman.run_maintenance('tst.child_test_1')
partman.run_maintenance()
ALTER TABLE tst.child_test_1 DETACH PARTITION <child_test_p_20260218>

The error persisted regardless of the method used.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Marcel Hofstetter 2026-02-27 13:36:30 Re: BUG #19404: manpages are missing in 18.x source.tar.gz
Previous Message Richard Guo 2026-02-27 08:13:52 Re: pg_get_viewdef() produces non-round-trippable SQL for views with USING join on mismatched integer types