Re: Column Filtering in Logical Replication

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Rahila Syed <rahilasyed90(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Column Filtering in Logical Replication
Date: 2021-07-01 06:20:36
Message-ID: CAFiTN-tGjBXwzgT_uuLR5kvjsyD6+eoRCa7NandvcDefwf0+QA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 1, 2021 at 1:06 AM Rahila Syed <rahilasyed90(at)gmail(dot)com> wrote:
>
> Hi,
>
> Filtering of columns at the publisher node will allow for selective replication of data between publisher and subscriber. In case the updates on the publisher are targeted only towards specific columns, the user will have an option to reduce network consumption by not sending the data corresponding to new columns that do not change. Note that replica identity values will always be sent irrespective of column filtering settings. The column values that are not sent by the publisher will be populated using local values on the subscriber. For insert command, non-replicated column values will be NULL or the default.
> If column names are not specified while creating or altering a publication,
> all the columns are replicated as per current behaviour.
>
> The proposal for syntax to add table with column names to publication is as follows:
> Create publication:
>
> CREATE PUBLICATION <pub_name> [ FOR TABLE [ONLY] table_name [(colname [,…])] | FOR ALL TABLES]
>
>
> Alter publication:
>
> ALTER PUBLICATION <pub_name> ADD TABLE [ONLY] table_name [(colname [, ..])]
>
>
> Please find attached a patch that implements the above proposal.
> While the patch contains basic implementation and tests, several improvements
> and sanity checks are underway. I will post an updated patch with those changes soon.
>
> Kindly let me know your opinion.
>

I haven't looked into the patch yet but +1 for the idea.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-07-01 06:34:26 Re: RFC: Logging plan of the running query
Previous Message Thomas Munro 2021-07-01 05:49:42 Re: pgbench logging broken by time logic changes