I use following SQL queries to check status on Postgres v11 usually.
On master:
select * from pg_stat_replication;
On replica (streaming replication in my case):
select * from pg_stat_wal_receiver;
https://stackoverflow.com/questions/43388243/check-postgres-replication-status
И очень полезный совет
For vertical output replace
;
with \x\g\x
Такой вот замороченный аналог mysql-ного \G
Ещё несколько запросов для слейвов
select pg_is_in_recovery();
select pg_last_xlog_receive_location();
select pg_last_xlog_replay_location();
SELECT CASE WHEN pg_last_xlog_receive_location() = pg_last_xlog_replay_location()
THEN 0
ELSE EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp())
END AS log_delay;
Комментариев нет:
Отправить комментарий