From: | Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> |
---|---|
To: | Shubham Khanna <khannashubham1197(at)gmail(dot)com> |
Cc: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> |
Subject: | Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided. |
Date: | 2025-03-25 11:38:44 |
Message-ID: | CAExHW5uvp6LWfgcysohDaOaNhqAbmuc=9BwWke=6KPRZ+wVOkA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Comments on 0001
@@ -87,6 +87,21 @@ PostgreSQL documentation
command-line arguments:
<variablelist>
+ <varlistentry>
+ <term><option>-a</option></term>
+ <term><option>--all</option></term>
+ <listitem>
+ <para>
+ Create one subscription per all non-template databases on the target
+ server. Automatically generated names for subscriptions, publications,
Already provided comment on this part.
+/*
+ * If --all is specified, fetch a list of all user-created databases from the
+ * source server.
+ */
The prologue of this function shouldn't mention --all and --database
option as it doesn't deal with those option itself. I would just say
"Fetch a list of all not-template databases from the source server.
/* Any non-option arguments? */
if (optind < argc)
{
@@ -2202,14 +2280,20 @@ main(int argc, char **argv)
pg_log_info("validating subscriber connection string");
sub_base_conninfo = get_sub_conninfo(&opt);
- if (opt.database_names.head == NULL)
+ /*
+ * Fetch all databases from the source (publisher) if --all is specified.
Add the relevant parts from fetch_source_databases() prologue here.
That is, just add, "This is treated as if the user specified multiple
--database options, one for each source database.".
+ */
+ if (opt.all_dbs)
+ fetch_source_databases(&opt);
+
extra line, not needed
This looks mostly ready except the test changes. I believe when
committing, we are going to squash all three into a single commit. Is
that correct?
On Tue, Mar 25, 2025 at 4:37 PM Shubham Khanna
<khannashubham1197(at)gmail(dot)com> wrote:
>
> On Tue, Mar 25, 2025 at 4:31 PM Ashutosh Bapat
> <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
> >
> > On Tue, Mar 25, 2025 at 4:28 PM Shubham Khanna
> > <khannashubham1197(at)gmail(dot)com> wrote:
> >
> > >
> > > The attached patches contain the suggested changes.
> > > [1] - https://www.postgresql.org/message-id/CAA4eK1KUDEO0t6i16_CcEpg33sgcgEddHcdVC_q8j4tVUb5FWw%40mail.gmail.com
> >
> > Forgot to attach patches?
> >
> > --
>
> Apologies for the oversight. I have attached the patches now. Please
> find them included here.
>
> Thanks and regards,
> Shubham Khanna.
--
Best Wishes,
Ashutosh Bapat
From | Date | Subject | |
---|---|---|---|
Next Message | Yura Sokolov | 2025-03-25 11:45:09 | Re: sinvaladt.c: remove msgnumLock, use atomic operations on maxMsgNum |
Previous Message | Amit Kapila | 2025-03-25 11:34:21 | Re: Fix 035_standby_logical_decoding.pl race conditions |