RE: Have pg_basebackup write "dbname" in "primary_conninfo"? - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Have pg_basebackup write "dbname" in "primary_conninfo"?
Date
Msg-id TYCPR01MB12077B81FCAFDFE104DEEE7BAF5592@TYCPR01MB12077.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: Have pg_basebackup write "dbname" in "primary_conninfo"?  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses Re: Have pg_basebackup write "dbname" in "primary_conninfo"?
List pgsql-hackers
> 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.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED
https://www.fujitsu.com/ 


pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Have pg_basebackup write "dbname" in "primary_conninfo"?
Next
From: Moaaz Assali
Date:
Subject: Fix for edge case in date_bin() function