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 1sbp3V-001fIx-10 for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Aug 2024 22:22:53 +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 1sbp3R-00AU2V-V7 for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Aug 2024 22:22:49 +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 1sbp3Q-00AU2N-ES for pgsql-bugs@lists.postgresql.org; Wed, 07 Aug 2024 22:22:49 +0000 Received: from fout6-smtp.messagingengine.com ([103.168.172.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbp3N-003bo2-7j for pgsql-bugs@lists.postgresql.org; Wed, 07 Aug 2024 22:22:47 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id 8EDEA138831F; Wed, 7 Aug 2024 18:22:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 07 Aug 2024 18:22:43 -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=fm3; t=1723069363; x= 1723155763; bh=FHupMHULFW+v/F79/AHsi355B5rAW69Ff0J//Qvr2lM=; b=r vUH6FILPaIgddNaeGlH5AdI2LvSWejb/QYcSnLRzT/TvJ2AQZob6U09zbgc+EcFK FrzvL9MiMj3Zc1QKclS/W8/jo6sgCMNlqr6AjPP8pZmocJJK5LtrGwMsDmt3Bqw2 ryGC7t7yryx2N2dlCzWzSJ7oZ3pGjO9fCBi/isPfezYllQlJCfptsbavUM1Gbmyw DeNKvtmwqefEh8+3wkDnVQxAnbovJ69hkl4OF1LUdvVPzcwFJi5puDm2t2M+b/kC umBktm2Z3VA5tRoJlZWNU3FHx8UxZxGy2JcArD6CrGowJ5kkYTEbjT+q1x5YR8ZB PZTAi9exwrxM77V6wfPJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrledugddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeelfeehgfeiteffffdufeeuvdefgeffueejtdehveduheej gfehheevudfggfefieenucffohhmrghinhepphhoshhtghhrrdgvshdpvghnthgvrhhprh hishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtg hpthhtoheptd X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Aug 2024 18:22:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1723069359; bh=gCI37jqT2GJDSkUg2n2mbM2Zy0etbZU7xp+UakyIgOc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=a1Wnn4PYyo02I09BL/cbxUwgFlYR+T/vAvPYGK+Gl/r8IubRfChF5bROKtsodfGOD 169/vUEsWS61yZ5sjteXWeh/Y03qRUUkTBDVbwjOuSY7He98ceH0BT90/buEscxARx p175dQsVG/uc8AOtKxCAoaEeQTcLRZcJPWWghijle76Vy8gGae2y8ZNwvQBDUMzEaY 2zJ1IgEQtjMNUshV6pIC54JRtFND2qena3upuEyIr7OK7Je+IixBbD4p/wvnmqcHJF WAiTK61X3DFn8nex1ZdzrbAHegFoUEzGEI3bGPiKlvtsY6ey8M/gBMLWvnMJ3GkKUV EFBmCIi1dfzcg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id DAC4F14DB; Thu, 8 Aug 2024 00:22:39 +0200 (CEST) Date: Wed, 7 Aug 2024 18:22:39 -0400 From: Alvaro Herrera To: Tender Wang Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error Message-ID: <202408072222.icgykv5yrql5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="oookcz4qaoqowmni" 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 --oookcz4qaoqowmni Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2024-Jul-15, Tender Wang wrote: > PG Bug reporting form 于2024年7月15日周一 21:02写道: > > The following script: > > CREATE TABLE t1 (a int, PRIMARY KEY (a)); > > CREATE TABLE t (a int, PRIMARY KEY (a), FOREIGN KEY (a) REFERENCES t1) > > PARTITION BY LIST (a); > > ALTER TABLE t ATTACH PARTITION t1 FOR VALUES IN (1); I propose to reject this with the attached patch, which I intend to backpatch all the way down to 12. FWIW, it's not the same problem that Jehan-Guillaume described in [1], even though the error message being thrown is the same. [1] https://postgr.es/m/20230705233028.2f554f73@karst -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ --oookcz4qaoqowmni Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Refuse-ATTACH-of-a-table-referenced-by-a-foreign-key.patch"