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 1tAA9W-00E5Wt-MF for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2024 15:47:01 +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 1tAA9S-007S2T-WA for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Nov 2024 15:46:59 +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 1tAA9S-007S2K-N0 for pgsql-hackers@lists.postgresql.org; Sun, 10 Nov 2024 15:46:59 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAA9Q-001DUJ-2O for pgsql-hackers@postgresql.org; Sun, 10 Nov 2024 15:46:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4AAFkmaO090867; Sun, 10 Nov 2024 10:46:48 -0500 From: Tom Lane To: Alvaro Herrera cc: Tender Wang , Alexander Lakhin , Jehan-Guillaume de Rorthais , "pgsql-hackers@postgresql.org" , Guillaume Lelarge Subject: Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails In-reply-to: <202411101328.qo4lzsmw2ixl@alvherre.pgsql> References: <202411101328.qo4lzsmw2ixl@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Sun, 10 Nov 2024 14:28:40 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <90865.1731253608.1@sss.pgh.pa.us> Date: Sun, 10 Nov 2024 10:46:48 -0500 Message-ID: <90866.1731253608@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > So it looks like we should suggest to save the output of the query, > execute each DROP followed by each ADD, and if the latter fails, fix the > violations and retry the ADD. Right. I'll make it so -- thanks for doing the legwork on creating the query! regards, tom lane