The PostgreSQL administration field guideField notes · Runbooks · Free certification

Section 2 of 3 · 7 minutes

Verify backup files and WAL delivery

Your goal

What you will be able to do

Check backup integrity, archive failures, retention, and encryption before a restore is needed.

Why this matters at work

The practical reason

A missing WAL segment or unreadable encrypted file can make an otherwise complete-looking backup unusable.

Learn

The idea in plain English

Use tool-specific integrity checks, file manifests, checksums, and archive monitoring. Alert on archive failures and on long periods without a successful archive when WAL is being generated.

Test access to encryption keys from the recovery environment. Retention must preserve a complete recovery chain, not just a collection of recent files.

Remember these points

  • Check the backup manifest and required WAL chain.
  • Monitor archive success and failure counts over time.
  • Test recovery access to encryption keys and object storage.

See it in SQL

Read archive success and failure evidence

Find the most recent successful and failed WAL archive attempts.

SELECT
  archived_count,
  last_archived_wal,
  last_archived_time,
  failed_count,
  last_failed_wal,
  last_failed_time,
  stats_reset
FROM pg_stat_archiver;

A rising failed count or an old success time during active WAL generation needs investigation.

The counters can reset. Save `stats_reset` with the observation and check the archive destination directly.

What you should see

Archive success and failure counts with the latest WAL file and timestamp for each outcome.

Useful words

Important terms

Recovery chain
The base backup and ordered WAL files needed to reach a chosen recovery point.

Quick check · Not graded

Check your understanding

What does a successful backup job prove by itself?

Choose one answer

Your progress is saved to your signed-in account.