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 1m5zsd-00012G-BB for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jul 2021 00:14:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m5zsc-000532-7P for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jul 2021 00:14:30 +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 1m5zsb-00052u-VS for pgsql-hackers@lists.postgresql.org; Wed, 21 Jul 2021 00:14:29 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5zsV-0001Dy-KH for pgsql-hackers@postgresql.org; Wed, 21 Jul 2021 00:14:29 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 34DE73200972; Tue, 20 Jul 2021 20:14:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 20 Jul 2021 20:14:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=/U2b1GWkSGo4EamYpHDsmlrtfXKvl76u7um6piXQs5w=; b=MsjcnboN HEjO001hm4nd+a3OGlkD5GFLKNkaYFNsyJMO6NZNc8iZNQBavwfSWVpnRS+h5kAQ d7jhrwDQramWtZSmGcLGNhsVUPACOHCApE82/VQG8tcVTfQ+NS/i3G+N0MzGHUS4 DA9AB13qdPQO80s5NijwID1/PINJhCTVQXyKLrvUI73g3eqxahSGZioxjkppZdCq ulYyDszu9/q659Bxk+DMJ0QzEEZGdlF4a2nOMZoj7J3w5VUXz6UfQPTTPzzogdaM r+jE0xgnGCqO6ZrzE9m5TQjVRqHRQz32qGcfyOeaempUu93spLkrO5OoGO3V+IAp KC3DXA6f8vhUHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeefgddvhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeevjedu feeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Jul 2021 20:14:21 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D828F2A077A; Tue, 20 Jul 2021 20:14:17 -0400 (-04) Date: Tue, 20 Jul 2021 20:14:17 -0400 From: Alvaro Herrera To: Rahila Syed Cc: Tomas Vondra , Peter Smith , PostgreSQL-development Subject: Re: Column Filtering in Logical Replication Message-ID: <202107210014.py4k662aarq5@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 Hello, I think this looks good regarding the PublicationRelationInfo API that was discussed. Looking at OpenTableList(), I think you forgot to update the comment -- it says "open relations specified by a RangeVar list", but the list is now of PublicationTable. Also I think it would be good to say that the returned tables are PublicationRelationInfo, maybe such as "In the returned list of PublicationRelationInfo, the tables are locked ..." In AlterPublicationTables() I was confused by some code that seemed commented a bit too verbosely (for a moment I thought the whole list was being copied into a different format). May I suggest something more compact like /* Not yet in list; open it and add it to the list */ if (!found) { Relation oldrel; PublicationRelationInfo *pubrel; oldrel = table_open(oldrelid, ShareUpdateExclusiveLock); /* Wrap it in PublicationRelationInfo */ pubrel = palloc(sizeof(PublicationRelationInfo)); pubrel->relation = oldrel; pubrel->relid = oldrelid; pubrel->columns = NIL; /* not needed */ delrels = lappend(delrels, pubrel); } Thanks! -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/