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.94.2) (envelope-from ) id 1slPoK-007WWI-HT for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Sep 2024 09:26:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1slPoI-009RJR-Hj for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Sep 2024 09:26:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slPoH-009RJJ-OA for pgsql-hackers@lists.postgresql.org; Tue, 03 Sep 2024 09:26:50 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slPoA-000QaA-Rp for pgsql-hackers@postgresql.org; Tue, 03 Sep 2024 09:26:48 +0000 Received: from karst (82-65-23-130.subs.proxad.net [82.65.23.130]) by mail.dalibo.com (Postfix) with ESMTPSA id 687B1275AE; Tue, 3 Sep 2024 11:26:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1725355600; bh=gXBdtRVXfYJBFyxdlXmNCtOEQOgBQQj+3/1YTNtf+zE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rFfVXwxbJrDsb3z2LV1Uooy2oJIysdLZMQGm7TC5mvPm07gZbGpT3rjopNukHdrS/ qS2kNPe+wk04MfWeirIc3FzlL5tgamFhJR1BtRLuUURcGfJtCK9f/eUk3fCosyMEnQ YtqRV02IXOakdub/KZP/NcctJU9bDPWfF78JtZ5w= Date: Tue, 3 Sep 2024 11:26:37 +0200 From: Jehan-Guillaume de Rorthais To: Tender Wang Cc: Alvaro Herrera , Junwang Zhao , "pgsql-hackers@postgresql.org" , Alexander Lakhin , Baehler Thomas SBB CFF FFS , Guillaume Lelarge , Michael Paquier Subject: Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails Message-ID: <20240903112637.03752732@karst> In-Reply-To: References: <20240820102651.273ecdf5@karst> <202408210309.d5q57gjclpcq@alvherre.pgsql> <20240902230147.0d3958bc@karst> Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Tender, On Tue, 3 Sep 2024 10:16:44 +0800 Tender Wang wrote: > Jehan-Guillaume de Rorthais =E4=BA=8E2024=E5=B9=B49=E6= =9C=883=E6=97=A5=E5=91=A8=E4=BA=8C 05:02=E5=86=99=E9=81=93=EF=BC=9A [=E2=80=A6] > > * Constraint & trigger catalog cleanup [1] (this thread) > > * FK broken after DETACH [2] > > * Maintenance consideration about self referencing FK between partitions > > [3] > > =20 >=20 > The third issue has been fixed, and codes have been pushed. Because of my > misunderstanding, > It should not be here. I just retried the SQL scenario Guillaume gave on both master and master wi= th Alvaro's patch. See: https://www.postgresql.org/message-id/flat/CAECtzeWHCA%2B6tTcm2Oh2%2Bg7fURU= JpLZb-%3DpRXgeWJ-Pi%2BVU%3D_w%40mail.gmail.com It doesn't seem fixed at all. Maybe you are mixing up with another thread/i= ssue? > > 0. Splitting in two commits > > > > [=E2=80=A6] > > > > Unfortunately, this discussion about the first bug slipped to the sec= ond > > one when Tender stumbled on this bug as well and reported it. But, bo= th > > bugs can be triggered independently, and have distinct fixes. >=20 > It's ok that these two issues are fixed together. It is because current > codes don't handle better when the referenced side is the partition table. I don't feel the same. Mixing two discussions and fixes together in the same thread and commit makes life harder. Last year, when you found the other bug, I tried to point you to the right thread to avoid mixing subjects: https://www.postgresql.org/message-id/20230810170345.26e41b05%40karst If I wrote about the third (non fixed) issue yesterday, it's just because Alvaro included a reference to it in his commit message. But I think we sho= uld really keep up with this issue on its own, dedicated discussion: https://www.postgresql.org/message-id/flat/CAECtzeWHCA%2B6tTcm2Oh2%2Bg7fURU= JpLZb-%3DpRXgeWJ-Pi%2BVU%3D_w%40mail.gmail.com Regards