Blogacrynite.com

WAL and recovery points

How PostgreSQL write-ahead logging combines with a base backup to support point-in-time recovery.

PostgreSQL's write-ahead log (WAL) records changes made to the database. When WAL archiving is configured, completed WAL segments are sent to the configured archive destination. A physical base backup combined with a compatible, continuous WAL sequence can support point-in-time recovery.

Important distinctions

  • A base backup alone does not provide point-in-time recovery.
  • Configuring a WAL destination does not prove that every required WAL segment was archived.
  • Recovery requires a compatible base backup and an unbroken WAL sequence.
  • PostgreSQL validates WAL continuity during recovery.

Configured once per cluster

WAL archiving is configured once per PostgreSQL cluster, not once per backup schedule. A recovery point is only as reachable as the WAL chain leading to it.