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?
12 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) 3You 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.