Re: Have pg_basebackup write "dbname" in "primary_conninfo"?
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: "robertmhaas@gmail.com" <robertmhaas@gmail.com>,
"barwick@gmail.com" <barwick@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Date: 2024-03-11T11:45:57Z
Lists: pgsql-hackers
On Tue, Feb 27, 2024 at 2:07 PM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> > PSA the patch for implementing it. It is basically same as Ian's one.
> > However, this patch still cannot satisfy the condition 3).
> >
> > `pg_basebackup -D data_N2 -d "user=postgres" -R`
> > -> dbname would not be appeared in primary_conninfo.
> >
> > This is because `if (connection_string)` case in GetConnection() explicy override
> > a dbname to "replication". I've tried to add a dummy entry {"dbname", NULL} pair
> > before the overriding, but it is no-op. Because The replacement of the dbname in
> > pqConnectOptions2() would be done only for the valid (=lastly specified)
> > connection options.
>
> Oh, this patch missed the straightforward case:
>
> pg_basebackup -D data_N2 -d "user=postgres dbname=replication" -R
> -> dbname would not be appeared in primary_conninfo.
>
> So I think it cannot be applied as-is. Sorry for sharing the bad item.
>
Can you please share the patch that can be considered for review?
--
With Regards,
Amit Kapila.
Commits
-
Allow dbname to be written as part of connstring via pg_basebackup's -R option.
- a145f424d524 17.0 landed
-
Allow dbname in pg_basebackup/pg_receivewal connstring
- cca97ce6a665 17.0 cited