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

From Tom Lane
Subject Re: Libpq support to connect to standby server as priority
Date
Msg-id 30679.1547520797@sss.pgh.pa.us
Whole thread Raw
In response to Re: Libpq support to connect to standby server as priority  (Michael Paquier <michael@paquier.xyz>)
Responses RE: Libpq support to connect to standby server as priority  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Tue, Jan 15, 2019 at 02:00:57AM +0000, Tsunakawa, Takayuki wrote:
>> The original desire should have been the ability to connect to a
>> primary or a standby.  So, I think we should go back to the original
>> thinking (and not complicate the feature), and create a read only
>> GUC_REPORT variable, say, server_role, that identifies whether the
>> server is a primary or a standby. 

> From the point of view of making sure that a client is really
> connected to  a primary or a standby, this is the best idea around.

There are a couple of issues here:

1. Are you sure there are no use-cases for testing transaction_read_only
as such?

2. What will the fallback implementation be, when connecting to a server
too old to have the variable you want?

            regards, tom lane


pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: Protect syscache from bloating with negative cache entries
Next
From: Peter Geoghegan
Date:
Subject: Safely calling index_getprocinfo() while holding an nbtree exclusivebuffer lock