Field note
PostgreSQL Recovery: Test the Restore Point
Decide which transactions the business can lose before choosing the backup method.
An overnight PostgreSQL dump may be entirely adequate for one application and unacceptable for another. The difference is the amount of committed work the business can afford to reconstruct. A booking system taking orders all day has a different recovery requirement from a weekly reporting database.
Point-in-time recovery needs a usable base backup and the required sequence of write-ahead log files. It is worth implementing when the business needs finer recovery points, but it also creates an archive pipeline that must be monitored and tested.
Choose the recovery method by the failure
PostgreSQL distinguishes logical dumps from continuous archiving. A pg_dump file cannot serve as the base for replaying WAL. Physical recovery normally restores the cluster, while a logical dump is useful for selected databases and objects. The continuous-archiving documentation explains the distinction.
Keep both where their different purposes justify it. A logical export can simplify selective recovery or migration; a physical backup with WAL can support recovery to a chosen point. Neither removes the need to retain application configuration, extensions and relevant secrets separately.
Write two acceptance criteria before deploying the backup: maximum acceptable data loss and maximum acceptable time to a usable application. Include the time to obtain credentials, provision a destination and complete business checks. Counting only database startup understates the outage.
Protect the base backup and the archive chain
Use a supported backup tool or PostgreSQL's documented base-backup mechanism. Record the server major version, backup tooling version, tablespace layout and encryption dependencies with the backup. The pg_basebackup reference describes the available formats, WAL collection and operational requirements.
Keep the archive outside the production host's immediate failure boundary. A directory mounted from the same storage account with the same destructive credentials may protect against a single disk failure while providing little protection against administrator compromise.
An archiver must report success only after durable storage has accepted the required WAL. False success can create a missing segment that is discovered during recovery. Failure in the other direction can fill the local WAL directory and stop normal service. Both are reasons to monitor the archive, rather than trusting that the scheduler started.
Useful signals include the age of the last successful archive, recent failures, local WAL growth, remaining disk space and the age of the newest validated base backup. Set thresholds from workload behaviour: an idle database and a busy transaction service will produce different patterns.
Restore alongside production
Create an isolated recovery destination with the matching database major version and required extensions. Do not point the restored application at live payment, email or webhook destinations. A technically successful restore can still cause damage if scheduled jobs resume against real customers.
Choose a specific target time in an unambiguous timezone. Retain enough evidence to explain why it precedes the unwanted transaction. If the exact time is uncertain, restore several candidate points into disposable environments and compare business records.
For a controlled exercise, insert clearly labelled synthetic records before and after a planned marker in a test database. Verify that the selected recovery contains the expected earlier records and excludes the later ones. That gives the exercise a checkable result without manufacturing a production incident.
Do not assume that a database reaching a consistent state means the chosen recovery point was reached. Inspect the recovery logs and confirm the stopping condition. Missing WAL, an incorrect target or a mistaken timeline needs investigation before anyone approves a cutover.
Recover one business object carefully
If one customer or table was damaged, a full production rollback may discard valid work elsewhere. Restore the cluster separately, extract the required data and plan a reviewed repair. Preserve relationships, audit fields and application constraints; a quick copy of a few rows can create subtler inconsistencies.
PostgreSQL's SQL-dump guidance explains consistent logical exports and the extra treatment needed for cluster-wide objects. Use those capabilities intentionally, with a record of the source recovery point and the destination change.
Keep the evidence useful
The recovery record should identify the backup, archive range, target, operator, elapsed time and application acceptance checks. Record missing configuration and manual steps as defects, even when an experienced administrator worked around them.
Repeat the exercise after a major database upgrade, storage migration or backup-tool change. Keep the previous validated recovery route until the new one works. Where the database incident affects tenant access or communications, coordinate with the Microsoft 365 incident-response plan while keeping database recovery ownership explicit.
References
- PostgreSQL: Continuous Archiving and Point-in-Time Recovery. Accessed 17 October 2026.
- PostgreSQL: pg_basebackup. Accessed 17 October 2026.
- PostgreSQL: SQL Dump. Accessed 17 October 2026.
Related notes
17 Oct 2026 · 4 min
17 Oct 2026 · 4 min
17 Oct 2026 · 5 min
Need help mapping this to your own tenant, controls, or assessment timeline?