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 1stRYq-00GNqd-89 for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Sep 2024 12:56:04 +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 1stRYp-008OWi-Bo for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Sep 2024 12:56:03 +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.94.2) (envelope-from ) id 1stRYo-008OWa-R6 for pgsql-bugs@lists.postgresql.org; Wed, 25 Sep 2024 12:56:03 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stRYg-0011Q2-TH for pgsql-bugs@lists.postgresql.org; Wed, 25 Sep 2024 12:56:02 +0000 Received: from karst (82-65-23-130.subs.proxad.net [82.65.23.130]) by mail.dalibo.com (Postfix) with ESMTPSA id 31311272C3; Wed, 25 Sep 2024 14:55:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1727268955; bh=9o8Kf6xVZHmzhdybdr82ZWxaMe11C199SCi4EDM3za8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NA3pOy/Qocbe3owFOEEc8a5pSSUDp2AXRilLK40Ii1uw/lJB+wRSW/AXsnWfxgh/5 bAUvnfriCSPY4+4zXhkRqUCWJxrlFx++1klYlTdWqD4IrEpTAP/8K4gPWagkHhheDt spSeqc8iZ6692ZZjgariBuWnCp+eXAQKvAQZwJLU= Date: Wed, 25 Sep 2024 14:55:54 +0200 From: Jehan-Guillaume de Rorthais To: Tender Wang Cc: Alexander Lakhin , Alvaro Herrera , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18628: Race condition during attach/detach partition breaks constraints of partition having foreign key Message-ID: <20240925145554.57233b76@karst> In-Reply-To: References: <202409241123.dnrn6pdmoud6@alvherre.pgsql> <4fe75dda-d8cc-1763-9741-e1efdaed33d4@gmail.com> 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 On Tue, 24 Sep 2024 21:10:48 +0800 Tender Wang wrote: > Alexander Lakhin =E4=BA=8E2024=E5=B9=B49=E6=9C=8824= =E6=97=A5=E5=91=A8=E4=BA=8C 20:00=E5=86=99=E9=81=93=EF=BC=9A >=20 > > 24.09.2024 14:23, Alvaro Herrera wrote: > > > I suspect this is the same problem that was reported by Jehan-Guillau= me > > > de Rorthais, for which there are two patches proposed, his and mine: > > > > > > [1] https://postgr.es/m/202408072250.2c4fkhwf56lk@alvherre.pgsql > > > [2] https://postgr.es/m/20240905005728.0836d609@karst > > > > > > I haven't looked at his patch, but I suspect it's better than mine on > > > maintainability grounds. I think his code causes more catalog churn, > > > though perhaps we don't care too much about that in this particular > > > > Yes, v2-0001-Rework-foreign-key-....patch works for me =E2=80=94 the pa= rtition > > detached with no error. I just sent the v3 set of patchs, rebased against head (it was conflicting = with new temporal FK). See: https://www.postgresql.org/message-id/20240925144240.2b579a27%40karst Testing your scenario against current head fails. Testing your scenario against the v3 set of patchs doesn't show the error. Regards,