Enhances pg_createsubscriber documentation for the -d option.

Started by vignesh C11 months ago4 messages
#1vignesh C
vignesh21@gmail.com
1 attachment(s)

Hi,

Currently, pg_createsubscriber converts streaming replication to
logical replication using the specified database name. If the database
name is not provided, it is obtained from the --publisher-server
option. If the database name is not specified in either the --database
or --publisher-server option, an error is reported. This behavior is
not documented. The attached patch includes the necessary
documentation updates.

Regards,
Vignesh

Attachments:

0001-Enhances-pg_createsubscriber-documentation-for-the-d.patchapplication/octet-stream; name=0001-Enhances-pg_createsubscriber-documentation-for-the-d.patchDownload
From a1449fe87c7ac232981946d0993386d461e957b3 Mon Sep 17 00:00:00 2001
From: Vignesh <vignesh21@gmail.com>
Date: Wed, 26 Feb 2025 10:41:29 +0530
Subject: [PATCH] Enhances pg_createsubscriber documentation for the -d option.

Enhance pg_createsubscriber documentation to mention a) if the -database
option is not specified it will obtain the database name from
--publisher-server option. b) if the database name is not specified in either
the --database option or --publisher-server option, an error is reported.
---
 doc/src/sgml/ref/pg_createsubscriber.sgml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_createsubscriber.sgml b/doc/src/sgml/ref/pg_createsubscriber.sgml
index 65caa3f5095..cab820b991b 100644
--- a/doc/src/sgml/ref/pg_createsubscriber.sgml
+++ b/doc/src/sgml/ref/pg_createsubscriber.sgml
@@ -94,7 +94,10 @@ PostgreSQL documentation
       <para>
        The name of the database in which to create a subscription.  Multiple
        databases can be selected by writing multiple <option>-d</option>
-       switches.
+       switches. If this option is not provided, the database name will be
+       obtained from <option>-P</option>. If the database name is not specified
+       in either the <option>-d</option> option or <option>-P</option>, an
+       error is reported.
       </para>
      </listitem>
     </varlistentry>
-- 
2.43.0

#2Amit Kapila
amit.kapila16@gmail.com
In reply to: vignesh C (#1)
Re: Enhances pg_createsubscriber documentation for the -d option.

On Wed, Feb 26, 2025 at 11:34 AM vignesh C <vignesh21@gmail.com> wrote:

Currently, pg_createsubscriber converts streaming replication to
logical replication using the specified database name. If the database
name is not provided, it is obtained from the --publisher-server
option. If the database name is not specified in either the --database
or --publisher-server option, an error is reported. This behavior is
not documented. The attached patch includes the necessary
documentation updates.

<para>
        The name of the database in which to create a subscription.  Multiple
        databases can be selected by writing multiple <option>-d</option>
-       switches.
+       switches. If this option is not provided, the database name will be
+       obtained from <option>-P</option>. If the database name is not specified
+       in either the <option>-d</option> option or <option>-P</option>, an
+       error is reported.

How about changing it slightly as follows to make it clear: "If
<option>-d</option>option is not provided, the database name will be
obtained from <option>-P</option>. If the database name is not
specified in either the <option>-d</option> option or
<option>-P</option>, an error will be reported."?

--
With Regards,
Amit Kapila.

#3vignesh C
vignesh21@gmail.com
In reply to: Amit Kapila (#2)
1 attachment(s)
Re: Enhances pg_createsubscriber documentation for the -d option.

On Wed, 26 Feb 2025 at 14:35, Amit Kapila <amit.kapila16@gmail.com> wrote:

How about changing it slightly as follows to make it clear: "If
<option>-d</option>option is not provided, the database name will be
obtained from <option>-P</option>. If the database name is not
specified in either the <option>-d</option> option or
<option>-P</option>, an error will be reported."?

Looks good to me, here is an updated v2 version with the changes.

Regards,
Vignesh

Attachments:

v2-0001-Enhances-pg_createsubscriber-documentation-for-th.patchtext/x-patch; charset=US-ASCII; name=v2-0001-Enhances-pg_createsubscriber-documentation-for-th.patchDownload
From 600e8092d3612c0f66d65b50664e96a83a18f14c Mon Sep 17 00:00:00 2001
From: Vignesh <vignesh21@gmail.com>
Date: Wed, 26 Feb 2025 10:41:29 +0530
Subject: [PATCH v2] Enhances pg_createsubscriber documentation for the -d
 option.

Enhance pg_createsubscriber documentation to mention a) if the -database
option is not specified it will obtain the database name from
--publisher-server option. b) if the database name is either specified
in --database option or --publisher-server, an error is reported.
---
 doc/src/sgml/ref/pg_createsubscriber.sgml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_createsubscriber.sgml b/doc/src/sgml/ref/pg_createsubscriber.sgml
index 65caa3f5095..b4b996236e4 100644
--- a/doc/src/sgml/ref/pg_createsubscriber.sgml
+++ b/doc/src/sgml/ref/pg_createsubscriber.sgml
@@ -94,7 +94,10 @@ PostgreSQL documentation
       <para>
        The name of the database in which to create a subscription.  Multiple
        databases can be selected by writing multiple <option>-d</option>
-       switches.
+       switches. If <option>-d</option> option is not provided, the database
+       name will be obtained from <option>-P</option> option. If the database
+       name is not specified in either the <option>-d</option> option or
+       <option>-P</option> option, an error will be reported.
       </para>
      </listitem>
     </varlistentry>
-- 
2.43.0

#4Amit Kapila
amit.kapila16@gmail.com
In reply to: vignesh C (#3)
Re: Enhances pg_createsubscriber documentation for the -d option.

On Wed, Feb 26, 2025 at 4:48 PM vignesh C <vignesh21@gmail.com> wrote:

On Wed, 26 Feb 2025 at 14:35, Amit Kapila <amit.kapila16@gmail.com> wrote:

How about changing it slightly as follows to make it clear: "If
<option>-d</option>option is not provided, the database name will be
obtained from <option>-P</option>. If the database name is not
specified in either the <option>-d</option> option or
<option>-P</option>, an error will be reported."?

Looks good to me, here is an updated v2 version with the changes.

Pushed.

--
With Regards,
Amit Kapila.