Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWk7h-0002Jg-JF for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Mar 2022 19:24:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nWk7g-0000IB-20 for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Mar 2022 19:24:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWk7f-0000Hw-OZ for pgsql-hackers@lists.postgresql.org; Tue, 22 Mar 2022 19:24:51 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWk7d-0001QX-Ff for pgsql-hackers@postgresql.org; Tue, 22 Mar 2022 19:24:50 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E2E085C0528; Tue, 22 Mar 2022 15:24:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 22 Mar 2022 15:24:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date: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; bh=dNlWxC4rxVo1EHL0xV48riXLfJ7bmMSNBn9fHcMeZBY=; b=N7gsYGt9 JT8pdTG2NGQdQy+HRLebSs5K9p5E33v/MGPQ1ic2twoa+hn2OD7ui4SkWhT2GgRn zqvQco5K1mrCyyMngH4MY+I/VcH1IvGeCdoeEEUKiKNxjCMBNMwRuP8levalZo2A Hc/C1Yl5OtcprIAb+oxC0c45OquD/Xmi8ray7Mp8h9YPXSbXiWAEfnJ83DqX0nmG TUiJbfne3P4DkHoWfJ4Sc0VZqCaHX2PshKY2N7ZYPZ8YaLSmfKDLATrcr8JWvCox i9Ji83Sp0Q9++fnPKYnuvhxs8oiujhH/QfSA4uHiQf6vgLJA198PqZ2JNALk4W0a dvtUqa3XWYoCNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeghedguddvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeev jedufeeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Mar 2022 15:24:47 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 5383A2A0663; Tue, 22 Mar 2022 16:24:57 -0300 (-03) Date: Tue, 22 Mar 2022 20:24:57 +0100 From: Alvaro Herrera To: Tomas Vondra Cc: Amit Kapila , "houzj.fnst@fujitsu.com" , Peter Eisentraut , Justin Pryzby , Rahila Syed , Peter Smith , pgsql-hackers , "shiy.fnst@fujitsu.com" Subject: Re: Column Filtering in Logical Replication Message-ID: <202203221924.63iwr4ygjwat@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <566a06cd-fcb5-3e78-b2f0-8d21d92e5b87@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Mar-19, Tomas Vondra wrote: > @@ -174,7 +182,13 @@ ALTER PUBLICATION noinsert SET (publish = 'update, delete'); > > Add some tables to the publication: > > -ALTER PUBLICATION mypublication ADD TABLE users, departments; > +ALTER PUBLICATION mypublication ADD TABLE users (user_id, firstname), departments; > + > + > + > + Change the set of columns published for a table: > + > +ALTER PUBLICATION mypublication SET TABLE users (user_id, firstname, lastname), TABLE departments; > > > Hmm, it seems to me that if you've removed the feature to change the set of columns published for a table, then the second example should be removed as well. > +/* > + * Transform the publication column lists expression for all the relations > + * in the list. > + * > + * XXX The name is a bit misleading, because we don't really transform > + * anything here - we merely check the column list is compatible with the > + * definition of the publication (with publish_via_partition_root=false) > + * we only allow column lists on the leaf relations. So maybe rename it? > + */ > +static void > +TransformPubColumnList(List *tables, const char *queryString, > + bool pubviaroot) > +{ I agree with renaming this function. Maybe CheckPubRelationColumnList() ? -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "This is a foot just waiting to be shot" (Andrew Dunstan)