Postgres Replication Cheat Sheet

Streaming, logical, and backup replicas

Last Updated: November 21, 2025

Replication Modes

Mode Characteristics
Streaming Physical WAL
Logical Row replication
Cascade Chain replicas

Commands

CREATE REPLICATION SLOT
Reserve WAL
pg_basebackup -Fp
Bootstrap replica
SELECT pg_last_wal_receive_lsn()
Check lag

Guidance

Keep slots monitored, use synchronous commit sparingly, and document failover.

💡 Pro Tip: Monitor WAL lag, trim slots, and test failover regularly.
← Back to Databases & APIs | Browse all categories | View all cheat sheets