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 1tHI7o-005e6X-Az for pgsql-general@arkaria.postgresql.org; Sat, 30 Nov 2024 07:42:44 +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 1tHI7j-00EI9t-DN for pgsql-general@arkaria.postgresql.org; Sat, 30 Nov 2024 07:42:40 +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 1tHI7i-00EI9l-8G for pgsql-general@lists.postgresql.org; Sat, 30 Nov 2024 07:42:40 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tHI7f-000HTe-2f for pgsql-general@lists.postgresql.org; Sat, 30 Nov 2024 07:42:38 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 54A8B13801EF; Sat, 30 Nov 2024 02:42:32 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Sat, 30 Nov 2024 02:42:32 -0500 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=fm1; t=1732952552; x=1733038952; bh=3 MKEAYScdA1d3E6VOdMZs0EikFx+sQ0S4RzVRsjR8bs=; b=zrub0YoHjNVSYHMX5 be9fs7VYd2LgF2U8yQBm2V/AtAUjdf1mC+YDaBETnc8/08ysA2YsLzqGNuBIFiXw Lx+DcinfsbTmdBppx87eOZveDmsdrJy/SoRxAm6HOxOqZaz8fOx7f8Ilm+nhRcHa jwCUJQoXU7l7Ay3Pabhiv6YxpIDOVHa27oodonhgmm0TsBfHsGlF/dc+8s8NTKRx JDHz7eQNjcVbkK3khmNVwIENJw5xGlz3oLy8/K62RYA6y+1i3Mh1FnV9PUNfs6ze rrxJw8Hm/edi+yaM/yRQX6I733fNaSWpAz/dBExzBgAl+20FoqQETnjww1XAWmi8 zF/Bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrheeggddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffh jeejhffgieeuueekjeekfffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprh gtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhrtghpthhtohepphgruhhlrdhfohgvrh hsthgvrhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghl sehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlsehssh hsrdhpghhhrdhprgdruhhs X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 30 Nov 2024 02:42:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1732952462; bh=bftRbF3+PJmnRgcpvvVVBi+nywdsId2SzQb6CnOtxGU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=GuksQA5nUBZPo8UaHyZwrsHCokYz4GDbzFOLmln/85sm7M0Bpbqu+9Xtpim0YhJZp fDoQHr9Zk7ZDqQms9Q9kHFtGgmadVavPcDnR0ZdPJmNwRcozkCNsulgJLEijFUnr3F YXm/Yxj/FTkFjJMGGQoQ0GjC9sdFe/Az5HYzhT6EBQiQ/5UZIDFWuDZzc00Ab1ME99 BVzT6f7Nr3JuK85OkU0b0+wP+6Cqse2XUt5Lal2LC+TLqZhH/zpv9m+x/mrJYjokSc vlIi7Fvvhv+6bkVwk98e3NsUnZfyjQ5wB2wOaXhURa8zks6MvZM0Gkld/2wvyB7mWn fp8xLpvkzAZSA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 12B5195; Sat, 30 Nov 2024 08:41:02 +0100 (CET) Date: Sat, 30 Nov 2024 08:41:02 +0100 From: Alvaro Herrera To: Paul Foerster Cc: Tom Lane , Adrian Klaver , pgsql-general list Subject: Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION Message-ID: <202411300741.wuc7rpucq72o@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <41055379-D0D4-487D-9D8D-A624B79FEA56@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, On 2024-Nov-29, Paul Foerster wrote: > > On 29 Nov 2024, at 18:15, Alvaro Herrera wrote: > > This reports case 2 as OK and case 1 as bogus, as should be. I tried > > adding more partitions and this seems to hold correctly. I was afraid > > though that this would fail if we create an FK in an intermediate level > > of the partition hierarchy ... but experimentation doesn't seem to give > > that result. I've run out of time today to continue to look though. > > Thanks very much for this really detailed analysis and sharing your > insights. I'll give the new query a try on Monday when I'm back at > work. Do I also need to recheck all other databases with this new > query which didn't report anything with the original query? Only if you have self-referencing FKs in partitioned tables. It would be an interesting data point to verify whether this reports anything else. Also, I'd be really curious if your databases include the case I'm suspicious about: a multi-level hierarchy containing an FK that points to an intermediate level of itself. > > Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ > > "La vida es para el que se aventura" > > You're located in the middle of the forest east of Freiburg im > Breisgau in Germany? 🤣 I'm within fives minutes of longitude and latitude of that location, yes :-) I didn't want to give unnecessary precision there, but is somebody wants to chat sometime or whatever is welcome to ping me. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Estoy de acuerdo contigo en que la verdad absoluta no existe... El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)