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

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: a(dot)chodkowska(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19420: Zombie FK exists after partition is detached.
Date: 2026-03-02 12:14:40
Message-ID: 202603021208.em4tblut6ssg@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2026-Mar-02, Álvaro Herrera wrote:

> [...] But we had bugs in this area
> in previous versions, so maybe the problem is simply that you set up the
> partitions with the old versions, and the FKs have not been updated.
> See one of those fixes, probably the most relevant one, here:
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=53af9491a0439720094a11b72602952d79f59ac7
>
> Version 16.0 already contained this fix, so it certainly shouldn't
> happen with 16.6;

Sorry, I misspoke -- the fix was not in 16.0, but for 16.5 in that
branch. It's still true that 16.6 contains the fix. Here's a rundown
of release numbers on each branch for that bugfix:

Author: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Branch: master Release: REL_18_BR [53af9491a] 2024-10-22 16:01:18 +0200
Branch: REL_17_STABLE Release: REL_17_1 [5914a22f6] 2024-10-22 16:01:18 +0200
Branch: REL_16_STABLE Release: REL_16_5 [2aaf2a28b] 2024-10-22 16:01:18 +0200
Branch: REL_15_STABLE Release: REL_15_9 [5d83bad6b] 2024-10-22 16:01:18 +0200
Branch: REL_14_STABLE Release: REL_14_14 [46a8c27a7] 2024-10-22 16:01:18 +0200
Branch: REL_13_STABLE Release: REL_13_17 [d20194cea] 2024-10-22 16:01:18 +0200

Restructure foreign key handling code for ATTACH/DETACH

... to fix bugs when the referenced table is partitioned.

(Here I must decidedly credit
Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
for working on this fix.)

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"La fuerza no está en los medios físicos
sino que reside en una voluntad indomable" (Gandhi)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2026-03-02 14:19:29 Re: Major Version Upgrade failure due to orphan roles entries in catalog
Previous Message Álvaro Herrera 2026-03-02 10:22:05 Re: BUG #19420: Zombie FK exists after partition is detached.