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 1t3FwE-00BVAU-LB for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2024 14:32:46 +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 1t3FwC-000AZL-KI for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2024 14:32:44 +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 1t3FwB-000AZC-7n for pgsql-hackers@lists.postgresql.org; Tue, 22 Oct 2024 14:32:44 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3Fw8-002ISB-MJ for pgsql-hackers@postgresql.org; Tue, 22 Oct 2024 14:32:42 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 58E9013801A0; Tue, 22 Oct 2024 10:32:39 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Tue, 22 Oct 2024 10:32:39 -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=fm3; t=1729607559; x= 1729693959; bh=o27wdmfu4dyjK0t9pytEkw2XQ7OtDXTIJZgKTa/bTm8=; b=J 4CwNrw/88OrYz74B0E24uc2yETGahf/OPvbwFjSRtZMIgsNrRh/Bf9Feoor5aUkR Qs/HIExbIc0LXEY+VQ2/zmUflkYL2XUbLvrypi7nfpY6U8VsfbK8xJdQBx0wTfrR T4WDF4UqBSd9AwVrDAz5HL4fdsYAuhX7zjU2FRi3hzDJg+m8Va9qyWE2OrVTKgBr Ca+wMKRRRa5k0BMg73D3rxo2Msxx6dZWAZv9+oGpiEHa7nUq8CG+p9JpUdwnhtDG mVqyZiCNKdqVWY+UKDyAGt341UF1HyYfsDux94UjTamUOqJ+/Kj64Kg6EUriXudS UfVvZVkbe6ZQxgarqdIbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeihedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepveejieeileefhedukeetveek vdffvdeiffeitedviefhtdehjeevfeeufeevleetnecuffhomhgrihhnpehpohhsthhgrh gvshhqlhdrohhrghdpvghnthgvrhhprhhishgvuggsrdgtohhmpdhhrghtvghsqdhsohhf thifrghrvgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgt phhtthhopeejpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjghgurhesuggrlh hisghordgtohhmpdhrtghpthhtohepvgigtghluhhsihhonhesghhmrghilhdrtghomhdp rhgtphhtthhopehtnhgurhifrghnghesghhmrghilhdrtghomhdprhgtphhtthhopeiihh hjfihpkhhusehgmhgrihhlrdgtohhmpdhrtghpthhtohepghhuihhllhgruhhmvgeslhgv lhgrrhhgvgdrihhnfhhopdhrtghpthhtohepmhhitghhrggvlhesphgrqhhuihgvrhdrgi ihiidprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdr ohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Oct 2024 10:32:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1729607553; bh=bI/PZqwTkzVcU3cPIe7hsaDpC0+/LwBx3IxgiqZ08/M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=GiXCVLgOngelKbupZxvunBQsGR3c+cjba83H0NHp5FR+CnqN+T/YOOCsm8fwBMv53 iTLG987ihjiFLOtXbHlIklb1uB4XLZqvX5wqkQrMPE6u4CCNGgGe5nNRK2/kGrpEld PJSDXXontjwDKXiFXLqgVwmqjTX4pxzWNhvfX4Q2xvTQG9KJGL1r0ekzsxYQCtZP4F 3Hqv+o22PifSe1TStMI7zztgmEA5pLydx4nxNawAHj5ReYfOEMPU/N7k6dxFYFA3XX cCC027MnDDS/JHkkpbIBg1GZNzTKHjtbw5mUOj667SxY2lOQXTLi0pxmUKruXmjbeD d1ByGLTJfOxeA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 69C4CE3; Tue, 22 Oct 2024 16:32:33 +0200 (CEST) Date: Tue, 22 Oct 2024 16:32:33 +0200 From: Alvaro Herrera To: Jehan-Guillaume de Rorthais Cc: Tender Wang , Junwang Zhao , "pgsql-hackers@postgresql.org" , Alexander Lakhin , Guillaume Lelarge , Michael Paquier Subject: Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails Message-ID: <202410221432.3qtqbk2q6o7q@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241022162312.63021cc6@karst> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Oct-22, Jehan-Guillaume de Rorthais wrote: > On Fri, 18 Oct 2024 16:50:59 +0200 > Alvaro Herrera wrote: > > For branch 14, I opted to make it delete the constraints on detach. > > This isn't ideal but unless somebody wants to spend a lot more time on > > this, it seems the best we can do. Leaving broken constraints around > > seems worse. > > Keep that in mind, and move ahead to the next level: self-FK on partitioned > table! ;-) > > https://www.postgresql.org/message-id/flat/20230707175859.17c91538%40karst#0dc7b8afd8b780899021bbb075598250 Yeah. I pushed these patches finally, thanks! Now we can discuss what to do about self-referencing FKs ... maybe we should consider dropping the FK on detach in problematic cases. > > However, in the end I think this is a very good technique to verify that > > the fix works correctly, but it's excessive to include these results in > > the tests forevermore. So I've left them out for now. Maybe we should > > reconsider on the older branches? > > The point here was to make sure futur work/refactoring don't forget/break > anything in the catalog representation of FK on partitions. There is that ... but I think testing for user-visible symptoms is better. I'm not sure I want to bet against the odds that this will become make-work to keep the output of internal catalog state up to date for whatever other changes we need to do. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ Are you not unsure you want to delete Firefox? [Not unsure] [Not not unsure] [Cancel] http://smylers.hates-software.com/2008/01/03/566e45b2.html