From: | "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com> |
---|---|
To: | Shubham Khanna <khannashubham1197(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | RE: Add support for specifying tables in pg_createsubscriber. |
Date: | 2025-08-01 08:02:50 |
Message-ID: | OS0PR01MB5716D484A4A1F95E20E85B929426A@OS0PR01MB5716.jpnprd01.prod.outlook.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Monday, July 21, 2025 1:31 PM Shubham Khanna <khannashubham1197(at)gmail(dot)com> wrote:
>
> Hi hackers,
>
> Currently, pg_createsubscriber supports converting streaming
> replication to logical replication for selected databases or all
> databases. However, there is no provision to replicate only a few
> selected tables. For such cases, users are forced to manually set up
> logical replication using individual SQL commands (CREATE PUBLICATION,
> CREATE SUBSCRIPTION, etc.), which can be time-consuming and
> error-prone. Extending pg_createsubscriber to support table-level
> replication would significantly improve the time taken to perform the
> setup.
> The attached patch introduces a new '--table' option that can be
> specified after each '--database' argument. It allows users to
> selectively replicate specific tables within a database instead of
> defaulting to all tables. The syntax is like that used in 'vacuumdb'
> and supports multiple '--table' arguments per database, including
> optional column lists and row filters.
> Example usage:
> ./pg_createsubscriber \ --database db1 \ --table 'public.t1' \ --table
> 'public.t2(a,b) WHERE a > 100' \ --database db2 \ --table 'public.t3'
>
> I conducted tests comparing the patched pg_createsubscriber with
> standard logical replication under various scenarios to assess
> performance and flexibility. All test results represent the average of
> five runs.
>
> Thoughts?
Aside from the interface discussion, I think this is an interesting feature in
general. I got some feedback from PGConf.dev this year that many people favor
using pg_createsubscriber to accelerate the initial table synchronization phase.
However, some users prefer subscribing to a subset of tables from the publisher,
whereas pg_createsubscriber currently subscribes all tables by default. This
necessitates additional adjustments to publications and subscriptions afterward.
So, this feature could streamline the process, reducing the steps users need to
take.
Best Regards,
Hou zj
From | Date | Subject | |
---|---|---|---|
Next Message | Zhijie Hou (Fujitsu) | 2025-08-01 08:03:10 | RE: Add support for specifying tables in pg_createsubscriber. |
Previous Message | David G. Johnston | 2025-08-01 07:50:47 | When creating index, why pointing to old version of tuple |