pgsql: Support existing publications in pg_createsubscriber.

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема pgsql: Support existing publications in pg_createsubscriber.
Дата
Msg-id E1vVoFO-001EDf-0E@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Support existing publications in pg_createsubscriber.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/85ddcc2f4cdef490276d151c80459e287bceb782

Modified Files
--------------
doc/src/sgml/ref/pg_createsubscriber.sgml          |  8 ++
src/bin/pg_basebackup/pg_createsubscriber.c        | 95 +++++++++++++++++-----
src/bin/pg_basebackup/t/040_pg_createsubscriber.pl | 54 ++++++++++--
3 files changed, 132 insertions(+), 25 deletions(-)


В списке pgsql-committers по дате отправления: