recovery_target_action
A configuration parameter determining an action to be taken when the recovery target is reached
recovery_target_action
is a configuration parameter determining an action to be taken when the recovery target is reached
recovery_target_action
was added in PostgreSQL 9.5.
Usage
If one of the following recovery targets is set:
recovery_target
recovery_target_lsn
recovery_target_name
recovery_target_time
recovery_target_xid
the action specified in recovery_target_action
will be carried out; this can be one of:
pause
(the default)promote
shutdown
Default value
The default value for recovery_target_action
is: pause
.
Change history
- PostgreSQL 12
- PostgreSQL 9.5
- added as a
recovery.conf
parameter (initial commit aedccb1f)
- added as a
Note: initially added as action_at_recovery_target
, renamed to recovery_target_action
in commit b8e33a85).
Examples
Sample log output with a recovery target set and recovery_target_action
set to pause
:
[2020-12-23 11:12:56 CET] LOG: 00000: consistent recovery state reached at 0/2000100 [2020-12-23 11:12:56 CET] LOG: 00000: recovery stopping after reaching consistency [2020-12-23 11:12:56 CET] LOG: 00000: pausing at the end of recovery [2020-12-23 11:12:56 CET] HINT: Execute pg_wal_replay_resume() to promote. [2020-12-23 11:12:56 CET] LOG: 00000: database system is ready to accept read only connections
References
- PostgreSQL documentation: recovery_target_action
- PostgreSQL 11 documentation: recovery_target_action
Useful links
- Postgres 9.5 feature highlight - standby actions at the end of recovery - December 2014 blog article by Michael Paquier