Re: Have pg_basebackup write "dbname" in "primary_conninfo"?

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Have pg_basebackup write "dbname" in "primary_conninfo"?
Date: 2024-03-20 11:39:21
Message-ID: CAA4eK1JMdAr3UdDvE-evSkqaKdUXMgD1E3sExGFX73fDkFCgkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 19, 2024 at 5:18 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Thanks for giving comments!
>
> > This behavior makes sense to me. But do we want to handle the case of
> > using environment variables too?
>
> Yeah, v5 does not consider which libpq parameters are specified by environment
> variables. Such a variable should be used when the dbname is not expressly written
> in the connection string.
> Such a path was added in the v6 patch. If the dbname is not determined after
> parsing the connection string, we call PQconndefaults() to get settings from
> environment variables and service files [1], then start to search dbname again.
>

The functionality implemented by the patch looks good to me. I have
made minor modifications in the function names, error handling,
comments, and doc updates in the attached patch. Let me know what you
think of the attached.

--
With Regards,
Amit Kapila.

Attachment Content-Type Size
pg_basebackup-write-dbname.v0007.patch application/octet-stream 8.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-03-20 11:46:00 Re: remaining sql/json patches
Previous Message Dean Rasheed 2024-03-20 11:22:58 Re: Catalog domain not-null constraints