Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvwL5-00BPHz-0G for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Feb 2026 11:48:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvwL4-002xqR-02 for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Feb 2026 11:48:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvtrN-0027aM-0Y for pgsql-bugs@lists.postgresql.org; Fri, 27 Feb 2026 09:10:09 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vvtrJ-00000001XdA-2Yuj for pgsql-bugs@lists.postgresql.org; Fri, 27 Feb 2026 09:10:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=4UQWu0CUENUAk15lCMGitPj+PPKC1dVENHca24vUciQ=; b=Wo6OpmFeHuzEn7W4OMpR7zn6wW e/HEDXK6xwKmcTjfEj276syc4PSZYWM3Fuhi/RmEoIGsH6b2eKIMl8N85GqvSO5mXRH8991evU06a G/OkBi8O7ARWLn8y1HBytogCnMwZzUEWA4RTUHuyr55ZWamzpW+4vfQTTHuKgVyIUjXSy2KdEk5Iq 1wsgwG8KjQclhEJ0VrCDNGDfXD4icUa0mff5Sm2MmCZ9Ibx2ZbNjLRCCrNPsJCCdo54Oe/CvWPoNO H9QE4IXuerb11IOXtOkB6s7hyPXJAVGbptVZplbY/2sZkA+hbKBtoZgEJHQ6dUIC3X+NP4qYKh3Be XS51DySw==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvtrI-004GFp-0w for pgsql-bugs@lists.postgresql.org; Fri, 27 Feb 2026 09:10:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvtrH-00D7Zx-2C for pgsql-bugs@lists.postgresql.org; Fri, 27 Feb 2026 09:10:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19420: Zombie FK exists after partition is detached. To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: a.chodkowska@gmail.com Reply-To: a.chodkowska@gmail.com, pgsql-bugs@lists.postgresql.org Date: Fri, 27 Feb 2026 09:09:36 +0000 Message-ID: <19420-ec7f929dce3a7e14@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19420 Logged by: Agnieszka Chodkowska Email address: a.chodkowska@gmail.com PostgreSQL version: 16.6 Operating system: Linux, Debian 12.2.0 64 bit Description: =20 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=3Dfalse , retention_keep_index =3D 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 The error persisted regardless of the method used.