summaryrefslogtreecommitdiff
path: root/scripts/checkPostgreSQLrepl
blob: 20b74fe9a62a6a3551fdf09e549730ccc1e70a09 (plain)
1
2
3
4
5
#!/bin/bash

CHECKSQL="SELECT application_name AS name, COALESCE(client_hostname, CAST(client_addr AS TEXT)) AS client, state, sync_state AS type, pg_wal_lsn_diff(sent_lsn, replay_lsn) AS lag FROM pg_stat_replication"
echo "$CHECKSQL" | psql -U postgres -h firebrand
echo "$CHECKSQL" | psql -U postgres -h defiant