postgres-errors-replication-lag

Installation
SKILL.md

postgres-errors-replication-lag

Quick Reference :

Three replication problems, three different views to inspect :

Problem Where to look Key signal
Streaming replica behind pg_stat_replication (on PRIMARY) replay_lag, byte diff vs replay_lsn
Slot retaining too much WAL pg_replication_slots (on PRIMARY) active = false, wal_status not reserved
Logical subscription behind / stuck pg_stat_subscription (on SUBSCRIBER) stale latest_end_time, errors in subscriber log

Two failures cause real outages :

  1. Inactive slot fills the primary disk. A replication slot pins WAL from restart_lsn forward. If its consumer stops connecting, restart_lsn never advances and pg_wal grows without bound until the primary crashes on a full disk. ALWAYS set max_slot_wal_keep_size as a safety cap and ALWAYS alarm on inactive slots.
Installs
1
GitHub Stars
1
First Seen
Jun 17, 2026
postgres-errors-replication-lag — impertio-studio/postgresql-claude-skill-package