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 1qRUEU-001w6H-9c for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Aug 2023 09:02:58 +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 1qRUES-00BimS-Kf for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Aug 2023 09:02:57 +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 1qRUER-00BimK-If for pgsql-hackers@lists.postgresql.org; Thu, 03 Aug 2023 09:02:56 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRUEO-000Ipn-DI for pgsql-hackers@postgresql.org; Thu, 03 Aug 2023 09:02:55 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 47F195C004A; Thu, 3 Aug 2023 05:02:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 03 Aug 2023 05:02:47 -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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1691053367; x= 1691139767; bh=Ou982iv4T/Dbc6//kSXEnJcKX5HTaXOZ+njynzbamC4=; b=I W3+6q/bXb5WxEErct9KR1/Z31s+W/Un+YvlpwT9sgOnOPeo+8QtnTAlmLOE27i71 bsmFPkfVLNKhCzO96tCwyWE1tqm54q4ZGuOndN20QN0dt3lMlgKLtlXcWSqGHnyR To7opcRgNhE/VNwhYDkYqQfugSppQUXsge5UXKHxvJn0DlBcWwPA27Qg43mt5Z4J VVSqYp0DucPFBiTyXExTWnCUP/ElWdxmEo7EJxmHdpExubNEv0sENUuaxMLUlAS4 GdTibA7lanyoC3fc8q3GAVdWn40zTFK5h4uHtxVwvfuwxwBfdhNFOxlJE3gta94R QkjnhZs7/YxP1v90kvhBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrkedvgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Aug 2023 05:02:46 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id E658CE3; Thu, 3 Aug 2023 11:02:43 +0200 (CEST) Date: Thu, 3 Aug 2023 11:02:43 +0200 From: Alvaro Herrera To: tender wang Cc: Jehan-Guillaume de Rorthais , "pgsql-hackers@postgresql.org" Subject: Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails Message-ID: <20230803090243.5ba3mapddthv6yhn@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 On 2023-Aug-03, tender wang wrote: > I think old "sub-FK" should not be dropped, that will be violates foreign > key constraint. Yeah, I've been playing more with the patch and it is definitely not doing the right things. Just eyeballing the contents of pg_trigger and pg_constraint for partitions added by ALTER...ATTACH shows that the catalog contents are inconsistent with those added by CREATE TABLE PARTITION OF. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/