Re: Proposal: Implement failover on libpq connect level.
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: vitus@wagner.pp.ru
Cc: pgsql-hackers@postgresql.org
Date: 2015-09-07T15:32:48Z
Lists: pgsql-hackers
Victor Wagner wrote: > It would just take a bit more time for client and a bit more load for > server - to make sure that this connection is read-write by > issuing > > show transaction_read_only > > statement before considering connection useful. If the purpose of the feature is to wait for a failover to complete, shouldn't it check for pg_is_in_recovery() rather than transaction_read_only ? That's because a database or user can be made read-only-on-connect on an otherwise read-write instance by issuing ALTER DATABASE dbname SET default_transaction_read_only TO on; The same for a user with ALTER USER. In that case, transaction_read_only would be OFF after connecting, both on the master and on a slave, independantly of any failover in progress or finished or not having occurred at all. Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
Commits
-
libpq: Add target_session_attrs parameter.
- 721f7bd3cbcc 10.0 landed
-
Remove superuser checks in pgstattuple
- fd321a1dfd64 10.0 cited
-
Fix unwanted flushing of libpq's input buffer when socket EOF is seen.
- c405918858c0 9.6.0 cited