Recovery target
A recovery target is the configured condition at which database log replay should stop.
PostgreSQL 18 accepts one target type: time, transaction ID, LSN, named restore point or the earliest consistent state. The inclusive setting governs time, transaction-ID and LSN boundaries; timeline selection identifies the history branch. [1]
Action: for a configured target, recovery_target_action chooses whether to finish recovery (promote), stop the server (shutdown), or pause for inspection (pause, the default). With hot_standby off, pause acts as shutdown; during ongoing promotion it acts as promote. At a target pause, pg_wal_replay_resume() ends recovery. A later target requires stopping the server, changing the target and restarting. The shutdown action retains recovery.signal, so an unchanged restart stops again. The action has no effect without a configured target. [1]
Inspection: pg_is_wal_replay_paused() reports a request, not necessarily a completed pause. pg_get_wal_replay_pause_state() distinguishes not paused, pause requested and paused; the last means replay is actually paused. [4]
Relations
- related
- Point-in-time recovery, WAL archiving, Restore test, Recovery point objective, PostgreSQL timeline, Full backup
Advantages
- An explicit target makes the intended replay endpoint inspectable. [1]
Limitations
- PostgreSQL raises a fatal error if archive recovery ends before a configured target is reached. [1]
- A target is a recovery setting, not the recovery point objective that specifies acceptable data loss. [1, 2]
Citations
- PostgreSQL 18: Recovery Target
- NIST SP 800-34 Rev. 1: Recovery objectives
- PostgreSQL 18: Recovery Control Functions, requested and actual pause states