On Sat, 7 Mar 2026 at 14:08, Andrey Borodin <[email protected]> wrote:
>
> > On 5 Mar 2026, at 19:55, Tom Lane <[email protected]> wrote:
> >
> > TBH, I'd say that your DNS setup is broken and you should fix it.
> > It makes no sense to have the same DNS entry pointing to both
> > read-write and read-only hosts.  The proposed patch will mainly
> > result in useless connection attempts in more-sanely-constructed
> > setups.
>
> This is very desired feature by cloud providers.
>
> We sell PGaaS clusters which are just a bunch of hosts. Each of
> these hosts can became primary any time.
> Currently, when user adds more hosts they have to redeploy\reconfigure
> their app.

Somewhat related, we're using dynamic DNS to track the primary, but we
want a backup in case the dynamic DNS fails. We're using multi-host
connection strings for this, with a hostname like
"foo,foo1,foo2,foo3,foo4", where "foo" is the dynamic hostname and
"foo1"..."foo4" are CNAMEs to individual hosts. By updating the
CNAMEs, we can bring hosts in and out without reconfiguring clients.

Managing that is more complex than using a single fallback hostname
with an IP address for each host. It's annoying that we need an upper
bound on the number of potential primaries when configuring the
client. We could do better if libpq tried each IP address of a host
until it got an acceptable connection.


Reply via email to