Re: pg_createsubscriber --dry-run logging concerns

Peter Smith <smithpb2250@gmail.com>

From: Peter Smith <smithpb2250@gmail.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Euler Taveira <euler@eulerto.com>, "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-09T00:55:55Z
Lists: pgsql-hackers

Attachments

On Wed, Oct 8, 2025 at 9:04 PM Álvaro Herrera <alvherre@kurilemu.de> wrote:
>
> On 2025-Oct-08, Peter Smith wrote:
>
> > I am not wedded to doing this double-messaging... if people feel just
> > the one-time logging at the beginning is enough, then that is OK by
> > me.
>
> Some other tools (not Postgres ones) do that and it always makes me
> nervous, because I can never be sure which parts were actually done and
> which parts are only dry-run trials.  I'd rather stay away from that
> approach.
>

OK. Here are v2 patches to implement both ways. You can pick one or both.

0001 - a beginning log to say if the tool is in dry-run mode
0002 - alternate pg_log_info messages for pg_createsubscriber, when in
dry-run mode

~

Note: there might be a clash with another thread [1] if that gets
committed soon; I will deal with any rebase if/when it is needed.

======
[1] https://www.postgresql.org/message-id/flat/CAHut%2BPv7qDvLbDgc9PQGhULT3rPXTxdu_%3Dw%2BiW-kMs%2BzPADR%2Bw%40mail.gmail.com

Kind Regards,
Peter Smith.
Fujitsu Australia

Commits

  1. Split dry-run messages into primary and detail

  2. Log a note at program start when running in dry-run mode

  3. Use USECS_PER_SEC from datatype/timestamp.h

  4. Remove WaitPMResult enum in pg_createsubscriber

  5. pg_createsubscriber: reword dry-run log messages