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 1sblkR-001Hzh-Am for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Aug 2024 18:50:59 +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 1sblkP-009Knz-E6 for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Aug 2024 18:50:57 +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 1sblkO-009Knq-IN for pgsql-bugs@lists.postgresql.org; Wed, 07 Aug 2024 18:50:57 +0000 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sblkM-003aOM-2T for pgsql-bugs@lists.postgresql.org; Wed, 07 Aug 2024 18:50:55 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfout.nyi.internal (Postfix) with ESMTP id 302B21383617; Wed, 7 Aug 2024 14:50:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 07 Aug 2024 14:50:53 -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=1723056653; x= 1723143053; bh=ww90TLKyxRkwfoXiPgF3oURrTPi0XikujGxXW6F5oSs=; b=Q A/AT9Tv9ykj8iCJpNiocx92bcLV+gT1GmHhRr9nNWdazIobwhJHxb7+aRORvCuVw D9JwErEelIT7A7Q9Fc5QzSnaPJp/U3OViTxfLckIiZo7VpA9JgCewOFqOdXwYDVx Gyaa5N8LlbudaVISGtwNSvKldKMTls7xzoWRkXirYNLEJpEX6BMI0CiUEAaGn6aK 2LYXX/0qsXvOI6cmYHRBP2HTBDIZ7VNVlxTPgAkkAsECqVUStvMQeQz1YipE49fs cYcLjaiIOXjymKuUyxBohsHJrr8pjXwwx/eBD7lEOOLNRoqz2whTWzNdJ4xFw+yn uh5pM6hbhg4vUXqOpFshA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrledtgddufedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopedt X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Aug 2024 14:50:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1723056650; bh=ByFKBVtL0tz2HUGuS4nzMvcu9RJihtunt23hDyNvev0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=GQ8RthiXNEos6vVHk+QP8GQSBKa8DFAyLlqkTrqErml4dBSCvOQhv7KhKcnc8KwE7 BDnlq7BhCbkXVtJZw+IVMIa90tDXVb7ugCCVPkkgqPjL7UrC2b9ygvaC/clT5Wb9ON +hx/HMDYWgw0w8XBb0TwxIDxvDCazD2JSjqLpravqW5FfakBvQLFRrIkrhrmczEejP zGs/oC76eNZ07u+bFaKJQHtZXgv0d3NNNmEVzSy/X4cm7cJmPDXqnENizJyX0jSDME tiLJNrfG9Yr3v3CsogykEu5Nwxg8LI5Xpc7zO0C4zoF/OEnjgPm2Xqom2LB6a9YuWb K+IdrUxVXeG7A== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id C553314DB; Wed, 7 Aug 2024 20:50:50 +0200 (CEST) Date: Wed, 7 Aug 2024 14:50:50 -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: <202408071850.g7wjetpfbloe@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202408071844.d7mzelswgpdu@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Aug-07, Alvaro Herrera wrote: > I think this schema is nuts. Do you have a practical use for something > like this? FWIW if you try to set this up the other way around, you get a different error: create table t (a int primary key) partition by list (a); create table t1 partition of t for values in (1); alter table t add foreign key (a) references t1; ERROR: cannot ALTER TABLE "t1" because it is being used by active queries in this session so I'm not bothered by the restriction in functionality. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/