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 1st3dy-00DCf8-BV for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Sep 2024 11:23:47 +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 1st3dx-006jSh-3j for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Sep 2024 11:23:45 +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 1st3dw-006jRr-PX for pgsql-bugs@lists.postgresql.org; Tue, 24 Sep 2024 11:23:44 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1st3dp-000nYT-UP for pgsql-bugs@lists.postgresql.org; Tue, 24 Sep 2024 11:23:43 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id A01DC114017D; Tue, 24 Sep 2024 07:23:36 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Tue, 24 Sep 2024 07:23:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727177016; x= 1727263416; bh=r42vPPQyZjQAh1EVIDN5nS0m3wODAotFgz632mi/E6Q=; b=a GuM1smMOn0lGrKfmCfnwH/8gFN5PaWgKdsqPEydS6NVXRVPCqhqUHp6G0SCNU/oJ pOYZUnhEcBBr2VEE3mbYU1t4Dou1I/LXpNkeroWDPb6sJufd/hNHkpckVfKvYlJd GTPa1GMv9VhF3B3xD3N6YMpX4Reyl/Cp1TsBCEsls/ufczZtBbAfXomoTrtwrJV9 wwwSeqci8U4zcDu+UqoUuSfFVS0EM5TO+FDafZiPvpnRmSLsJ+sFqxi5ae4tK9BX 5qcCogUETtmJjGEzFBsscWyr/vtD2CZUuB4LnYc4/bdOxwO2kN9Wq8wonomJjjkI 2HzK0Xhhjias8u6GLZlzw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddtvddgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvve fukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghr rgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtth gvrhhnpeeuiefgffeukedtgfetueeugfetvdeuhefgheelfeehleejleefffejtddtkedv jeenucffohhmrghinhepphhoshhtghhrrdgvshdpvghnthgvrhhprhhishgvuggsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghl vhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtghpthhtohepvddpmh houggvpehsmhhtphhouhhtpdhrtghpthhtohepvgigtghluhhsihhonhesghhmrghilhdr tghomhdprhgtphhtthhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvg hsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Sep 2024 07:23:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1727177013; bh=7YEzPxc6i4YjderJDMBXITWHRIvOO7GGxzbIgABbYtQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=mwfenk7/T2hAPMBb8YETJDYzj2E7fF9kmReKEH1EEg0KLBuoEYzfH8zCabv6CLA0S ciHiNMTP74Vywdr0nUGvsbID7ezULEq9TpLIq49qgSa2HZ+TUQLqIeYmNZR55HlgtE OsPMT48YCS1xby5Zx11XZ5dBm95No1hZsBdgZqnFYvs3aC9ApN9tC8RWI1TANKqzX+ uLOKmOPb4YQ97d09bex0iex9wNlFt/5uV6jjRQzj0A4uK4/CPzbPm2tFM/I1NME9Zh 9FD2gr7+TtGM6BmRdsmFi57+5miq6GYzLVrY4cLKjn7/XUTBYPZPRlvEUh3ku6LTxG Bjqdfy58nomyQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 3544CD9; Tue, 24 Sep 2024 13:23:33 +0200 (CEST) Date: Tue, 24 Sep 2024 13:23:33 +0200 From: Alvaro Herrera To: Alexander Lakhin Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18628: Race condition during attach/detach partition breaks constraints of partition having foreign key Message-ID: <202409241123.dnrn6pdmoud6@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2db29417-eac1-35b6-94e3-a9c0bdb9c035@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Sep-24, Alexander Lakhin wrote: > I'm sorry,  I' was too hasty to untangle those queries. Now I see that > this error can be produced with this serial script: > [...] I suspect this is the same problem that was reported by Jehan-Guillaume 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 case. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/