PostgreSQL repmgr Setup Replication with Automatic Failover

snow capped peaks of trentino alto adige

PostgreSQL does not include automatic failover out of the box.
When the primary goes down, someone has to promote the standby manually — which means downtime.
repmgr adds an automatic failover daemon (repmgrd) that monitors the cluster and promotes the standby within seconds when the primary fails.
This guide walks through setting up a two-node PostgreSQL 18 cluster with streaming replication and automatic failover on Ubuntu 24.04, using repmgr 5.x.
Every step has been run live on a real cluster and the output verified.

Continue reading “PostgreSQL repmgr Setup Replication with Automatic Failover”

PostgreSQL 18 Backup & Recovery Lab on Ubuntu 24.04 — pg_dump, pg_basebackup and pgBackRest

red and blue abstract painting

If you work with PostgreSQL in production, backups are not optional.

In this lab, I built a complete PostgreSQL 18 backup and recovery environment on Ubuntu 24.04 and tested all three major backup approaches:

  • logical backups with pg_dump
  • physical backups with pg_basebackup
  • production-grade backups with pgBackRest, including WAL archiving and Point-In-Time Recovery (PITR)

Everything was tested on a real VM with actual recovery drills — not simulations.

Continue reading “PostgreSQL 18 Backup & Recovery Lab on Ubuntu 24.04 — pg_dump, pg_basebackup and pgBackRest”