recovery_target_time
Read PG 18 manual ↗This parameter specifies the time stamp up to which recovery will proceed.
- Type
- string
- Context
- postmaster
- Measured default
- Empty string
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
This parameter specifies the time stamp up to which recovery will proceed. The precise stopping point is also influenced by recovery_target_inclusive.
The value of this parameter is a time stamp in the same format accepted by the timestamp with time zone data type, except that you cannot use a time zone abbreviation (unless the timezone_abbreviations variable has been set earlier in the configuration file). Preferred style is to use a numeric offset from UTC, or you can write a full time zone name, e.g., Europe/Helsinki not EEST.
Measured default history
| Version interval | Default |
|---|---|
| 12 – 19 | Empty string |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
Sets the time stamp up to which recovery will proceed. The value is fixed when the server starts, so changing it requires a restart.
Recovery compares transaction commit records with this timestamp; numeric UTC offsets or full time-zone names avoid abbreviation ambiguity. recovery_target_inclusive selects whether commits exactly at the boundary are replayed.
At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, and recovery_target_xid may be set; timeline, inclusive, and action are modifiers. Rehearse from the same base backup through a complete WAL chain—an unreachable target makes targeted recovery fail.
Operational considerations
Using an ambiguous time-zone abbreviation instead of a numeric offset or full zone name.
Assuming one wall-clock timestamp uniquely identifies a business transaction.
Setting another recovery target selector at the same time.
Choosing inclusive on/off without identifying the exact boundary commit.
Requesting a time outside the reachable WAL range or on the wrong timeline.
Workload guidance
OLAP: For a large restore, budget WAL replay and inspection time first. Validate the reached point read-only; do not let heavy analytical queries delay or contaminate the recovery decision.
OLTP: This is not a steady-state performance knob. Set recovery_target_time only on an isolated recovery instance after recording target evidence, base backup, timeline, and expected boundary; rehearse and require a second-person review.
SMALL: Prefer a backup tool that generates a controlled recovery configuration. Never leave target settings in ordinary primary/standby templates, and clean up signal files and targets afterward.
Version history 1
- PG 11 → 12added
Related entries
Further reading
Definition snapshot: english-manuals:01dce5ed2a6a940b145b83294c7… · English manual source