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

From: Shubham Khanna <khannashubham1197(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: 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>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Subject: Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.
Date: 2025-02-12 07:48:27
Message-ID: CAHv8RjJCo=5r9OP8JXRvSFUVHADjNPoPm-CNNX3NsFaLkNTjQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 12, 2025 at 6:46 AM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Dear Shubham,
>
> Thanks for updating the patch! I feel the patch has good shape. Here is a small comment.
>
> ```
> + /* Error if no databases were found on the source server */
> + if (num_rows == 0)
> + {
> + pg_log_error("no databases found on the source server");
> + pg_log_error_hint("Ensure that there are user-created databases on the source server.");
> + PQclear(res);
> + disconnect_database(conn, false);
> + exit(1);
> + }
> ```
>
> I think the error message is not accurate. This error can happen when there are
> user-created database but it is created as template. How about below:
>
> ```
> - pg_log_error("no databases found on the source server");
> - pg_log_error_hint("Ensure that there are user-created databases on the source server.");
> + 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.");
> ```
>

Fixed the given comment. The attached patch at [1] contains the
suggested changes.

[1] - https://www.postgresql.org/message-id/CAHv8RjKc6LMJ86b4yCmwNTn0c65mz0BGMCF-vPJSKDMOGagVGA%40mail.gmail.com

Thanks and regards,
Shubham Khanna.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nitin Jadhav 2025-02-12 07:58:55 Address the bug in 041_checkpoint_at_promote.pl
Previous Message Zhijie Hou (Fujitsu) 2025-02-12 07:46:22 RE: Introduce XID age and inactive timeout based replication slot invalidation