Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

Shubham Khanna <khannashubham1197@gmail.com>

From: Shubham Khanna <khannashubham1197@gmail.com>
To: Peter Smith <smithpb2250@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Amit Kapila <amit.kapila16@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: 2025-02-13T03:27:49Z
Lists: pgsql-hackers

Attachments

On Thu, Feb 13, 2025 at 4:48 AM Peter Smith <smithpb2250@gmail.com> wrote:
>
> Some review comments for v7-0001
>
> ======
> src/bin/pg_basebackup/pg_createsubscriber.c
>
> 1.
> + /* Error if no databases were found on the source server */
> + if (num_rows == 0)
> + {
> + pg_log_error("no convertable databases found on the source server");
> + pg_log_error_hint("Ensure that there are non-template and
> connectable databases on the source server.");
> + PQclear(res);
> + disconnect_database(conn, false);
> + exit(1);
> + }
>
> 1a.
> The spelling is "convertible", not "convertable"
>
> ~
>
> 1b.
> What does "convertible databases" mean here, and will that term make
> sense to a user? How are we "converting" the source server databases;
> AFAIK we are simply connecting to them and adding publications.
>
> IMO a better choice of adjectives can be found below.
> "no suitable databases found..."
> "no appropriate databases found..."
> "no eligible databases found..."
> etc.
>

Fixed.

The attached patch contains the required changes.

Thanks and regards,
Shubham Khanna.

Commits

  1. Cosmetic fixes for pg_createsubscriber's -all option.

  2. pg_createsubscriber: Add '--all' option.