diff options
| author | Amit Kapila | 2025-12-17 09:43:53 +0000 |
|---|---|---|
| committer | Amit Kapila | 2025-12-17 09:43:53 +0000 |
| commit | 85ddcc2f4cdef490276d151c80459e287bceb782 (patch) | |
| tree | 2fd9ce0c59218e8e18ab1fead1b1c66280f73c11 /doc/src/sgml/ref/pg_createsubscriber.sgml | |
| parent | f4e797171eac645eeae2a5e95bf3361bb7f7f0cc (diff) | |
Allow pg_createsubscriber to reuse existing publications instead of
failing when they already exist on the publisher.
Previously, pg_createsubscriber would fail if any specified publication
already existed. Now, existing publications are reused as-is with their
current configuration, and non-existing publications are created
automatically with FOR ALL TABLES.
This change provides flexibility when working with mixed scenarios of
existing and new publications. Users should verify that existing
publications have the desired configuration before reusing them, and can
use --dry-run with verbose mode to see which publications will be reused
and which will be created.
Only publications created by pg_createsubscriber are cleaned up during
error cleanup operations. Pre-existing publications are preserved unless
'--clean=publications' is explicitly specified, which drops all
publications.
This feature would be helpful for pub-sub configurations where users want
to subscribe to a subset of tables from the publisher.
Author: Shubham Khanna <khannashubham1197@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Reviewed-by: Peter Smith <smithpb2250@gmail.com>
Reviewed-by: Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: vignesh C <vignesh21@gmail.com>
Reviewed-by: tianbing <tian_bing_0531@163.com>
Discussion: https://postgr.es/m/CAHv8Rj%2BsxWutv10WiDEAPZnygaCbuY2RqiLMj2aRMH-H3iZwyA%40mail.gmail.com
Diffstat (limited to 'doc/src/sgml/ref/pg_createsubscriber.sgml')
| -rw-r--r-- | doc/src/sgml/ref/pg_createsubscriber.sgml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/pg_createsubscriber.sgml b/doc/src/sgml/ref/pg_createsubscriber.sgml index bb9cc72576c..5a62187b189 100644 --- a/doc/src/sgml/ref/pg_createsubscriber.sgml +++ b/doc/src/sgml/ref/pg_createsubscriber.sgml @@ -285,6 +285,14 @@ PostgreSQL documentation a generated name is assigned to the publication name. This option cannot be used together with <option>--all</option>. </para> + <para> + If a specified publication already exists on the publisher, it is reused. + It is useful to partially replicate the database if the specified + publication includes a list of tables. If the publication does not exist, + it is automatically created with <literal>FOR ALL TABLES</literal>. Use + <option>--dry-run</option> option to preview which publications will be + reused and which will be created. + </para> </listitem> </varlistentry> |
