recovery_target_action
Fact — official short description: “Sets the action to perform upon reaching the recovery target.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG12 |
| Present in | PG12–19 Beta 3 |
| Removed in | No |
| Introduction commit | 2dedf4d9a899 — Integrate recovery.conf into postgresql.conf |
| Commit date | 2018-11-25 |
| Discussion | thread 1 |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG12–19 Beta 3 | pause |
— | pause |
How it works
Selects what PostgreSQL does after it reaches a configured recovery target. The value is read when recovery starts.
pause leaves recovery paused for inspection, promote ends recovery and opens the server for normal service, and shutdown stops the server at the target. pause requires hot_standby for query inspection.
The setting has no effect without a stopping target. With shutdown, recovery.signal is not removed, so an unchanged restart reaches the target and shuts down again; remove or change the recovery configuration deliberately after validation.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | This is not a steady-state performance knob. Set recovery_target_action only on an isolated recovery instance after recording target evidence, base backup, timeline, and expected boundary; rehearse and require a second-person review. |
| 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. |
| Small nodes | 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. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG12–19 Beta 3 unmodified; OLAP: PG12–19 Beta 3 unmodified; CRIT: PG12–19 Beta 3 unmodified; TINY: PG12–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Expecting an action when no stopping target is configured.
- Using pause with hot_standby disabled and expecting to inspect the database with queries.
- Using promote before the recovered state has been verified.
- Using shutdown and restarting with recovery.signal and the same target still present.
- Treating shutdown as permanent removal of later WAL; the next start still replays from the last checkpoint to the target.
Related parameters
recovery_target · recovery_target_time · recovery_target_lsn · recovery_target_inclusive · recovery_target_timeline · hot_standby
References
- PostgreSQL 19 Beta 3 — recovery_target_action
- PostgreSQL 19 release notes
- Machine-readable GUC export