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

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-02-03T03:30:47Z
Lists: pgsql-hackers
On Thu, Jan 30, 2025 at 3:17 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> I found that pg_rewind with --write-recovery-conf option doesn't write
> the dbname to an auto-generated primary_conninfo value. Therefore,
> after a failover, the old primary cannot start if it's rewound by
> pg_rewind with --write-recovery-conf option if sync_replication_slots
> is on. Is it an oversight in commit a145f424d5?
>

IIRC, we tried to do minimal in the first version as we didn't have
all the use cases. However, it makes sense to support this in HEAD as
proposed by you.

-- 
With Regards,
Amit Kapila.



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.