Skip to main content

Point-in-Time Recovery (PITR)

Learning Focus

Use this lesson to understand PITR at a high level: base backups + archived WAL + a recovery target.

Concept Overview

PITR allows restoring to "just before" a failure (bad deploy, accidental delete) by:

  1. restoring the latest base backup
  2. replaying WAL from an archive up to a target time/LSN

Requirements

  • regular base backups
  • WAL archiving enabled (archive_mode = on)
  • durable WAL archive storage
  • a restore process that can fetch WAL (restore_command)

Recovery Planning Checklist

  • define RPO/RTO
  • test restore in non-production
  • document recovery steps and verification queries

Common Mistakes & Troubleshooting

MistakeWhat happensFix
No WAL archiveCannot recover to a point in timeEnable WAL archiving
No restore testsUnknown RTO / broken backupsRestore-test regularly

Quick Reference

PITR = base backup + WAL archive + target time/LSN

What's Next