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 1uDvSq-0003DA-JO for pgsql-sql@arkaria.postgresql.org; Sun, 11 May 2025 01:26:49 +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 1uDvSp-0070jB-HR for pgsql-sql@arkaria.postgresql.org; Sun, 11 May 2025 01:26:47 +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 1uDvPe-006wEf-Rz for pgsql-sql@lists.postgresql.org; Sun, 11 May 2025 01:23:31 +0000 Received: from flow-b7-smtp.messagingengine.com ([202.12.124.142]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uDvPa-001H3s-2r for pgsql-sql@postgresql.org; Sun, 11 May 2025 01:23:30 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailflow.stl.internal (Postfix) with ESMTP id F173D1D40162; Sat, 10 May 2025 21:23:24 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sat, 10 May 2025 21:23:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1746926604; x= 1746933804; bh=NGojc+pjAbADEAeQw5fNnAHQzjnjuprte5qN0XVl2HU=; b=Q tFDq8uc2a7b+ptR5KjbOvsusov4MCVwV5j9p3mLGARFmrGbZAY6xml1ILHfKhbOz kXRiOqfMytIltX1PXi9AiKk8zNOrxbwygmPOIgc1Km3sTKV3dQopfXQF5+vRwiji DaF1YPlenbIFCME6gKnwQYBr5ZZI0NwsS+ocR19wrOlPG7VR8AYva+nkHLPb/aP7 /yvLfI45gLr4hj6Bnhc4p145uh00sVxY9vPz9rA/af7+5TekEbmxA+Cn2CirhqoB IRm84H/xV6PYyLYPK8hj+oTsk51Z5iDtymbBiAqthNQNg72We5+c7uvaDOHTV8g7 G/NCqChW1IUAUCnU9KGzA== 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-sender :x-me-sender:x-sasl-enc; s=fm3; t=1746926604; x=1746933804; bh=N Gojc+pjAbADEAeQw5fNnAHQzjnjuprte5qN0XVl2HU=; b=sIQ8NLb3HY7ShixmJ DH/BAjRhrhGGQ00jeDME6JkRi00vppH3GEUicbM2DT1B57lcs3MG6ORu+mxIzmla 8IjwrJjFG0s5ABM9KSnbeasdPZ/Fon0AdOTcNQRu/8Na0ABSWRbm7e3KaHSi0K6E 2Hx2T4549pR5Z7y2xC90dhii3eDvl+iYO0yZFP1XKTtVgprckTLWdtca4mhRA2tc NoOX+dTvzYFfSgc3hcwbmzr1b28EEDaaONjiff7LS5nt+24IvoUIeVMlXhRNUOS/ pA2oKRP28fff+JFiTWvot3FmgnmhOtT0rO5tWyGAgG2wlpmtuYtjv3jsDjPjmqKN th35w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvleejtdehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcujfgvrhhr vghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrfgrthhtvg hrnhepfeegveekteejhfeukefghfffkeeihfeuleejieffteettedtffekkeeljeejhfdu necuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpvghnthgvrhhprhhishgvug gsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheprghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedvpd hmohguvgepshhmthhpohhuthdprhgtphhtthhopehshhhithgrlhdrmhhoughisehmihgt rhhoshhofhhtrdgtohhmpdhrtghpthhtohepphhgshhqlhdqshhqlhesphhoshhtghhrvg hsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 May 2025 21:23:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1746904393; bh=ChxjpvQeGa05eVyqvLF8JJZ4sw2z5t/f1tOov+wqm6M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=SGXFBE+503SG22Y+82yRRyXjEotz4aI3gFSfw8UaUojH7IPJmFaKs55lIaBpPtFCl pa1G539Opf9CIeYOeCBYuFLEqePoxG9EkHpSp5JugW3z0Pk1yIYcJuFVVpugtifqo+ mf3Zeyi7pO/Ce54fG70NJoQo6NakDLZpN4VHdlcxAqLXb9FJGIeB4tWvCeUji+RyoJ +qF8n3Dfu1e8biv2+t9t5A9VeySPBqzV+Wr4QuOX4A00e8ZOV09SHep1Kju/k4f2jt ack0PxBaleIv9U0PwVs0svxdhcjcxppVWrxvPXWtmuf4UYNgAKSsSM5Syd8YmsEw3S DOQuwh7LgIzHQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 812F091; Sat, 10 May 2025 15:13:13 -0400 (EDT) Date: Sat, 10 May 2025 15:13:13 -0400 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Shay Patel Cc: "pgsql-sql@postgresql.org" Subject: Re: Detached partitioning tables with RF keys in latest minor version is changed Message-ID: <202505101913.ebamsfg4flpf@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, On 2025-Apr-14, Shay Patel wrote: > Prior to PostgreSQL version 15.7 AND 16.2, we were able to detach the > partitioning table with RF keys without dropping the keys ,handled > automatically. I don't understand your problem. I took your script and ran it in 15.8 and found that it runs to completion with no errors. What problem are you facing exactly? If you run a command that gets an error, what's the command that you run and what's the error? (You use the term "RF keys" which is not one I know, but I assume you mean foreign key constraints). > Afterwards version must drop the RF keys to detach the partition, why > it's not automatically handled like it's handled while attaching the > partitioning tables with rf keys? We recently made some changes on the behavior of foreign keys for partitioned tables, to fix some bugs. Maybe you've been affected for that; but 1) perhaps the situation you know face is the behavior that we had always intended and is now correctly implemented, or alternatively 2) you're facing a different problem that I don't understand. > Now , our automation script stopped working and there is no single > catalog table can give this information. We try very hard not to break behavior in stable branches, because we know it's problematic for users to find this kind of glitch after an upgrade. Maybe we overlooked something in this case. > Is there any catalog table which can query RF keys and it can list the > it's tables? Yes, you can query the pg_catalog.pg_constraint internal table; for instance: SELECT conname, confrelid::regclass FROM pg_constraint WHERE contype = 'f' AND conrelid = 'logs_child_2024_02'::regclass; would give you the constraint names of all foreign keys on table logs_child_2024_02, and also the table that it references. Feel free to ask if you want more guidance on the contents of the catalogs, but you can see the documentation, https://www.postgresql.org/docs/15/catalogs.html (I'm offline at the moment so I can't verify that the URL is fully correct.) > It's frustrating that script stopped working due to minor version > upgrade Yes, I understand how this can be frustrating. Regards -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "E pur si muove" (Galileo Galilei)