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 1tfLCx-001bVr-Hp for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Feb 2025 15:51:27 +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 1tfLCw-004wJR-LP for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Feb 2025 15:51:26 +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 1tfLCv-004wJH-OR for pgsql-hackers@lists.postgresql.org; Tue, 04 Feb 2025 15:51:26 +0000 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tfLCs-003Fyf-2G for pgsql-hackers@lists.postgresql.org; Tue, 04 Feb 2025 15:51:25 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 60D7613800E2; Tue, 4 Feb 2025 10:51:21 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 04 Feb 2025 10:51:21 -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=1738684281; x=1738770681; bh=4 ixnkcxsTEGn2uZliInnA1RCAsyVRbgaI574nVKzxrI=; b=qAjIj1FnN7TU40Phu AzUjN51w4gzYVn30er+/VqLDW+GzJNeME0g+psVGivMJLuaOKZnTJU2nTPNns3jS C9SjMp1KiiUbYiO3B+VJLUaN2EFh5p0fN/yTHW3wiOR/famHhCXAmdWbl4MlWa2x /YVm7gfaecvQauaoKZNn/shllrldeX/QlLXDsy9rTG+CXG4ko7qQhOhkZDKs7sxF 0vkm97JxaLfs6hOYIICBJwjrbukRAlgvl7VmD+B2k6fUKjLaIR7YgE1PFkOvxqo0 kqtI7fBEKVlKUzbMcGggglKWvDdDEKintDFdSu6/uiGYraCH4Ql0Dorip59bUdpv 5O5Dg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdelfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeehjeetgeejgfefleefkeej vddthfeiueeiffejvdejkeetfeeltdeuffejtdeiieenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmpdhpohhsthhgrhdrvghsnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqd hiphdrohhrghdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtohepshhhlhhokhdrkhihrghlrdhoshhssehgmhgrihhlrdgtohhmpdhrtghpthhtoh epvhhighhnvghshhdvudesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhh rggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhope hsrdhtrghtrghrihhnthhsvghvsehpohhsthhgrhgvshhprhhordhruh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Feb 2025 10:51:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1738684279; bh=OlDWgAF9+NKfMwL/d3eH3dSpLnuZ9iYTt/eumE1cMGc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Y/Rf27w6+dkYKZF8t9WX9T3fTx2sUGtUGR9zIZ0bORJrksyXXOH1rsjQouUIQsZgL se0yZNi4rb/rMazTZ0KndxqACB6H52OZaIrGrpR0b4E3hLViPfAk45XvZVjEFVwfJR E2jEdOUcJWYxb0hwYceFU7EEVX5pJraWz0SreWZyU3bBWEQ2/gn9QRPsHbx2FjlHzS L9JQUoyuT3AXimtLsvXQEBGpbTJUPt/ktzXx/S+6qidTNRJiaOIgvj8SoFfd7Myahn r1FtmEsM3o0iI5IWdyHkDceh+B4CluFHGBixWUbbwJXPgURaaw6mqhSEwxzRZH3rHe KrD40/JkVI7QA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 279F58F; Tue, 4 Feb 2025 16:51:19 +0100 (CET) Date: Tue, 4 Feb 2025 16:51:19 +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: <202502041551.f7njlr25ie3u@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-04, vignesh C wrote: > We should throw an error for partitioned tables that contain foreign > partitions, as this would include the data from these foreign tables > during the initial sync, while incremental changes would not be > replicated. Hmm, I would support the idea of allowing partitioned tables containing foreign partitions into publications, where only the tuples in non-foreign partitions would be transmitted -- both during initial sync and during replicated DML. This way, any partitioned tables with mixed local and foreign partitions would work okay for replication. If the subscriber wants the data in the foreign partitions, they can create the foreign table on the subscription side and all is well. From a users POV this is probably the most useful. Another aspect is the case where you create the publication first and the foreign table later. I didn't spot in the proposed patch any code that would check whether a publication including this schema exists, which we would have to do if we wanted to be watertight about rejecting publications with foreign tables. But I think that would be a bad direction to go it. I'd rather have the table-listing code for publications skip any foreign tables. For instance, GetPubPartitionOptionRelations() and PublicationAddTables() should skip tables with relkind RELKIND_FOREIGN. The sync code should also silently ignore all foreign tables. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "I am amazed at [the pgsql-sql] mailing list for the wonderful support, and lack of hesitasion in answering a lost soul's question, I just wished the rest of the mailing list could be like this." (Fotis) https://postgr.es/m/200606261359.k5QDxE2p004593@auth-smtp.hol.gr