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 1tfb1i-003Zjw-BD for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Feb 2025 08:44:55 +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 1tfb1g-00Czlz-O5 for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Feb 2025 08:44:52 +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 1tfb1f-00Czlr-W1 for pgsql-hackers@lists.postgresql.org; Wed, 05 Feb 2025 08:44:52 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tfb1a-003HVv-1K for pgsql-hackers@lists.postgresql.org; Wed, 05 Feb 2025 08:44:51 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 4B49F11401AC; Wed, 5 Feb 2025 03:44:45 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 05 Feb 2025 03:44:45 -0500 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-sender :x-me-sender:x-sasl-enc; s=fm3; t=1738745085; x=1738831485; bh=a k51HCKI9rLo3qfjE+UXAbqCrTH9FZp7sTBaBywa8r4=; b=J7dkxD/qIfDbGb4wk W6wEtsNYhsRNuwn+WtxCVcBECCBfnduaVbQJj+G3h7ZxhX//bBggcQIeAq11gYTZ z+yI6ySMV6aqLXv7CDfVgAk3HfDPq8iUE8j87yshw4ntatRBkG2T8B92h439LPYj K7RG9G0oomB0WDKNYkbRAsO8X1gOmCyeMArT7BCVd71EHfHpcZV8kJFj9FKtj3zm 4yr77AGS1IFLXDk+bsUUw0sMAqWbtWCbKBecN31XkK6qUituapmf8lMKV2FeWjRg gtPwqPZcznEydx2eiBlabIVzSOvsoibaHvO4UiRh3hqK/BcPAwPfsN+s42Djyhbk +s7Rg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfedttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvheeuffehgfeukeeufeeh hefghfeugfefudekjeevudffgeffkeegffffveegheenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspg hrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshhhlhhokhdr khihrghlrdhoshhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepvhhighhnvghshhdvud esghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhs thhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehsrdhtrghtrghrihhnth hsvghvsehpohhsthhgrhgvshhprhhordhruh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Feb 2025 03:44:43 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1738745080; bh=jb8KHgonaJBTxmvGAKKG9W1BBJ+r+OGWnXD19mXsM+c=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=UUMrxfzhTdGMJNStHESkBeySfpnt8bD5zzLPhdsj9FkrnguDdz+8IqLZ+tWfOxBsI 6wNLrO99vy4MW4tArwR1GNtjpGcZon9LieYYfzNNXvM48SbDwpx5glodDmYL7ou5mW Enqyn1UoAn8h9va7sw1AxK6PwGjkhV/Hgd9nljlMwOfzAcFchw9p+evxC2wpLXDOT/ AU2AaVSWgwJXKErp7maoFM63Q3cxZH1NIOpAe1XnrJ5M6GNCnTRNBtqpLEOkyxoZxp k9YbwvX4tqmUEftl0P1/WBcVGQu63uRA5u+WcGjxKyDnnxsxm0OswvPca3CgRI3CDU 0B01aECeXwfdA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id E89ED90; Wed, 5 Feb 2025 09:44:40 +0100 (CET) Date: Wed, 5 Feb 2025 09:44:40 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: vignesh C Cc: Sergey Tatarintsev , Shlok Kyal , pgsql-hackers@lists.postgresql.org Subject: Re: Restrict publishing of partitioned table with a foreign table as partition Message-ID: <202502050844.4lrgg3aoudat@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 2025-Feb-05, vignesh C wrote: > We can maintain the behavior you suggested when the > PUBLISH_VIA_PARTITION_ROOT option is set to false. However, when > PUBLISH_VIA_PARTITION_ROOT is true, the table data is copied from the > root table (as intended by the user), which will also include the > foreign table data. In this case, wouldn’t it be better to throw an > error? It sounds to me a reasonable restriction that you can only add a partitioned table to a publication if publish_via_partition_root=false. Then the case of hybrid partitioned tables is supported, but it requires that changes are published directly by partitions, which is sensible anyway. In this case, during CREATE FOREIGN TABLE of a partition with this condition, we must check whether any publications include the schema that the table is being created on (or attached, for ALTER TABLE ATTACH PARTITION), and whether there are any publications that are FOR ALL TABLES that would be affected. (If we later figure out a way to allow publish_via_partition_root and skip the tuples in foreign partitions, it's easy to remove the restriction.) -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "That sort of implies that there are Emacs keystrokes which aren't obscure. I've been using it daily for 2 years now and have yet to discover any key sequence which makes any sense." (Paul Thomas)