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 1sPLOo-004A6Q-FO for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Jul 2024 12:17:18 +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 1sPLOm-00H1JM-Ca for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Jul 2024 12:17:17 +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 1sPLOl-00H1J2-He for pgsql-bugs@lists.postgresql.org; Thu, 04 Jul 2024 12:17:16 +0000 Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPLOi-000MhS-CO for pgsql-bugs@lists.postgresql.org; Thu, 04 Jul 2024 12:17:15 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 3627E11402F7; Thu, 4 Jul 2024 08:17:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 04 Jul 2024 08:17:11 -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=1720095431; x= 1720181831; bh=Jpk//KvY9m+jRns7Bp36DgV9kJyUyLdGbGqAp8DEqxM=; b=N hOF6UlGBXA4FgIFMxXp69A/wyV9Rj0UEKQ5bmUwuwG5g8SA6mJ8KEcfCgk0zO2AW KXrdZV6mOIpIm/SxrbNjFBauk8VrDisi1cku1w2mO70851vdEJeNj3hEkR4Zqxvv 8zToLjQWQOQOelQexHst0MIQMTDWlC0MdTxAVN5yu1uRWdeccY5/1LJBSjUhCGKB YZ229d0AOK+5xfdCcOFZ1CIXrrlktCR/OCFI7rwAyIACbk0TXZjp3M+5ossq19nb 1jQsXIVRzCOO8wug4VDBP9MI/ZJ5onvBy9Ayv+iWmDgw3ZZ7vdIv63rs8z11hLH7 fac32i49SNTdFa/HQE/XQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudelgdeglecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeduleekkefgtddttedtkefguddvieffleetgeejiefhteeh keevfeettdduvdfhueenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Jul 2024 08:17:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1720095429; bh=FDMlwGAKzwjbGtglSAtCRKAMdkfTpAW39LDJ+lZC/6Y=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=arnrbOxli2ibx1G84rzNwd1ZxHc65JpJ18fcsTZ6xIS3seHUlqW6vLLx0ajUEvUWm Smh9Y/5GVglaYoyvElAGX41hL0CGfj70FVf6x1oTzbW2d4KGIe1A4f8KIk5/w4Tk8/ rz1pXnQ+Z3DHyRkgaHkNX6tQpWrKGt7cAh84YzodKRMNgk15vph8eNbcgdYiwcY7wv eoYelynyxvL3/fzvtEq4cdOcVhJtfzkxDqFpDSEc0rNCYRhIxf2qGT7ggyK/nQ3i7c ge0XoOXB/Azs9+x8CG6tV3V4HaSuMqIimfGUjiEUTDGGdHL1YM6M5QzOh4p2DPtDuZ BrV3XCVGzhCHA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 06F7C529; Thu, 4 Jul 2024 14:17:09 +0200 (CEST) Date: Thu, 4 Jul 2024 14:17:08 +0200 From: Alvaro Herrera To: Tender Wang Cc: Michael Paquier , exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert Message-ID: <202407041217.tei7dtplpymg@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="rpbmmm3azzci27ms" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202407031821.2grjgjjcqovc@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --rpbmmm3azzci27ms Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Doh, somehow I forgot the patches once again. Here they are. I intend to push 0001 to all relevant branches soon, then park the rest until we have ALTER TABLE ... ADD PRIMARY KEY USING INDEX. On 2024-Jul-03, Alvaro Herrera wrote: > So here are three patches. 0001 adds a check at DETACH time so that if > a constraint has the form that we don't want to see, it copes without > crashing in the way Tender suggested. The code is different though, > mainly because we don't need his proposed has_superclass() function. It > also adds the test cases, and leaves one of the tables from it so that > pg_upgrade is tested. > > 0002 is the code that throws an error in any of the three problem cases; > roughly the same as the patch I posted as 0001 upthread. This is > incomplete in the sense that the regression tests would fail with it, > because I didn't modify the results. (I think we'd also remove the > DETACH line from those tests, because it'd be useless). > > 0003 adds the pg_upgrade check I mentioned: it scans the databases in > the source cluster for any constraints of the bogus form and fails the > upgrade if any exist. I tested this one very lightly (that is to say, > only with the database state left by the tests in 0001). -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ --rpbmmm3azzci27ms Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v3-0001-Cope-at-DETACH-time-for-12-16.patch"