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 1myFdO-00010z-2u for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Dec 2021 15:59:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1myFdN-0005ua-1w for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Dec 2021 15:59:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myFdM-0005uR-PN for pgsql-hackers@lists.postgresql.org; Fri, 17 Dec 2021 15:59:00 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myFdJ-0008HE-QM for pgsql-hackers@postgresql.org; Fri, 17 Dec 2021 15:59:00 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id CADF9320093A; Fri, 17 Dec 2021 10:58:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 17 Dec 2021 10:58:55 -0500 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= fm1; bh=GbB96nuM+06ua9myzvVVpUuq3ebVc58nYixZuGw+bX8=; b=GnrzsJ1z pZ4gmlHKjeblPUIx/PjEDdSHAulxZjvY6+9J92oSwz4wmy7NItYTGG61CYc8ijE0 o8rP7L3YXdXA0Fk+wjl+KV4NAAYTXhqcsCq+5rzI3fMGPjQsuFO1ZKNKO3AVPBu7 kiGuyKl/CD6kTkbGPbCZTh3e9abpN66j11Y/fnlaEtGeDjWHfEy8gGZCEZewS1kW OR5is6Y8cgtIGTpvyyTqemdVpOUHnNjY2OhmxvRxxG8TkZSOWF3tp6fcG0VsftlN SrrBMZHE0pOlLubMcvHSw6a5r8M7z/3uHyi3q66xTfy9rKMzEYACmezLhQvyOjCq O/ElN5lL8f1ZgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrleeigdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeevjedu feeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Dec 2021 10:58:53 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0010F2A07D0; Fri, 17 Dec 2021 12:58:50 -0300 (-03) Date: Fri, 17 Dec 2021 12:58:50 -0300 From: Alvaro Herrera To: Rahila Syed Cc: Amit Kapila , Tomas Vondra , Peter Smith , PostgreSQL-development Subject: Re: Column Filtering in Logical Replication Message-ID: <202112171558.klt66al2w5yg@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 2021-Dec-17, Rahila Syed wrote: > > This means that we need to support changing the column list of a > > table in a publication. I'm looking at implementing some form of > > ALTER PUBLICATION for that. > > I think right now the patch contains support only for ALTER > PUBLICATION.. ADD TABLE with column filters. In order to achieve > changing the column lists of a published table, I think we can extend > the ALTER TABLE ..SET TABLE syntax to support specification of column > list. Yeah, that's what I was thinking too. > > So this whole thing can be reduced to just this: > > > if (att_map != NULL && !bms_is_member(att->attnum, att_map)) > > continue; /* that is, don't send this attribute */ > > I agree the condition can be shortened now. The long if condition was > included because initially the feature allowed specifying filters > without replica identity columns(sent those columns internally without > user having to specify). Ah, true, I had forgotten that. Thanks. > > 900 + * the table is partitioned. Run a recursive query to iterate through all > > 901 + * the parents of the partition and retreive the record for the parent > > 902 + * that exists in pg_publication_rel. > > 903 + */ > > The above comment in fetch_remote_table_info() can be changed as the > recursive query is no longer used. Oh, of course. I'll finish some loose ends and submit a v10, but it's still not final. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "Right now the sectors on the hard disk run clockwise, but I heard a rumor that you can squeeze 0.2% more throughput by running them counterclockwise. It's worth the effort. Recommended." (Gerry Pourwelle)