I have setup replication: master - slave. Slave server works as hot-standby, which means we can run read-only sql queries. How actually can I see that slave server is serving read-only queries?

1

2 Answers

You can use pg_is_in_recovery() which returns True if recovery is still in progress(so the server is running in standby mode). Check the System Administration Functions for further informations.

=# SELECT pg_is_in_recovery(); pg_is_in_recovery ─────────────────── f (1 row) 
3

You can see simply with linux top command with pressing c. For example it is a process from our standby site top command list

postgres: pgUserNameSeen pgDatabaseName 10.10.10.10 (56608) idle 

if you do not see anything like that, your standby does not server for read-only queries.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.