Checking pg_stat_replication
Checking the archive and archive_command
is primarily for Point-In-Time-Recovery. If you want to monitor a streaming-based setup, it is advised to keep an eye on a system view called pg_stat_replication
. This view contains the following information:
test=# \d pg_stat_replication View "pg_catalog.pg_stat_replication" Column | Type | Modifiers ------------------+--------------------------+----------- pid | integer | usesysid | oid | usename | name | application_name | text | client_addr | inet | client_hostname | text | client_port | integer | backend_start | timestamp with time zone | backend_xmin | xid | state | text | sent_location | pg_lsn | ...