Re: Libpq support to connect to standby server as priority - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Libpq support to connect to standby server as priority
Date
Msg-id 20181117001409.GB1182@paquier.xyz
Whole thread Raw
In response to Re: Libpq support to connect to standby server as priority  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: Libpq support to connect to standby server as priority
List pgsql-hackers
On Sat, Nov 17, 2018 at 10:41:54AM +1100, Haribabu Kommi wrote:
> Yes, we need either session open or reconnect it approach to find out
> the whether server is read-write or read-only.

Even if there is no agreement on this part, wouldn't a read-only option
be enough to support any case?  With a cluster of two nodes, one primary
and one standby, a connection string listing both nodes would fail only
in the middle of a planned failover.  If you rinse and repeat it is
possible to have a larger control at application level because you
precisely know the whole state of the cluster at a given instant.

> And also for read-only or prefer-read connection types, once after the
> connection establishment is done, later server promotes to read-write,
> I feel we can continue the connection, that decision makes the feature
> simple, or do we want to stop the connection?

That feels like something the application needs to care about once the
session is established, but that's only my take on the matter.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: ATTACH/DETACH PARTITION CONCURRENTLY
Next
From: Andres Freund
Date:
Subject: Re: Why do pg_upgrade's test use the serial schedule? (actual thread)