Check replication lag postgres

Replication state and byte lag per replica

psql -U postgres -c "SELECT client_addr, state, sent_lsn, replay_lsn, (sent_lsn - replay_lsn) AS lag_bytes FROM pg_stat_replication;"
more postgres all 29 commands →