Re: Libpq support to connect to standby server as priority
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>,
Dave Cramer <pg@fastcrypt.com>, Robert Haas <robertmhaas@gmail.com>,
"laurenz.albe@cybertec.at" <laurenz.albe@cybertec.at>,
Haribabu Kommi <kommi.haribabu@gmail.com>,
Jing Wang <jingwangian@gmail.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-01-15T02:53:17Z
Lists: 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
Commits
-
Make test_target_session_attrs more robust against connection failure.
- 3769e11a3183 14.0 landed
-
Extend the abilities of libpq's target_session_attrs parameter.
- ee28cacf619f 14.0 landed
-
Mark default_transaction_read_only as GUC_REPORT.
- d16f8c8e416d 14.0 landed
-
Introduce a new GUC_REPORT setting "in_hot_standby".
- bf8a662c9afa 14.0 landed
-
Avoid spamming the client with multiple ParameterStatus messages.
- 2432b1a04087 14.0 landed
-
Avoid harmless Valgrind no-buffer-pin errors.
- a766d6ca22ac 14.0 cited
-
Restructure libpq code to remove some duplicity
- b438e7e7a1c5 13.0 landed
-
libpq: Add target_session_attrs parameter.
- 721f7bd3cbcc 10.0 cited