RE: pg_rewind with --write-recovery-conf option doesn't write dbname to primary_conninfo value.

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Masahiko Sawada' <sawada.mshk@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-02-12T05:36:01Z
Lists: pgsql-hackers
Dear Sawada-san,

Thanks for updating the patch!

> I've attached the updated patch. I address all comments I got so far
> and added a small regression test.
> 
> It makes sense to me that we move GetDbnameFromConnectionOptions() to
> recovery_gen.c since this function is currently used only with
> GenerateRecoveryConfig() which is defined in the same file. If we find
> a more appropriate place, we can move it later. Feedback is very
> welcome.

I considered your idea that adding new API, but it seemed for me to have less
benefit. Also, I do not know better place for the declaration now. Overall, the
patch looks good to me.

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Commits

  1. pg_rewind: Add dbname to primary_conninfo when using --write-recovery-conf.

  2. Allow dbname to be written as part of connstring via pg_basebackup's -R option.