14
Point-in-Time Recovery (PITR)
recovery_target = 'immediate' restore consistency only
recovery_target_name = 'name' to a named restore point created with
pg_create_restore_point('name')
recovery_target_time = 'timestamp' up to the specified timestamp
recovery_target_xid = 'xid' to the specified transaction
recovery_target_lsn = 'lsn' to the specified LSN
recovery_target_inclusive = on|off whether to include the target point
recovery_target_action = pause
pause
promote accepts connections
shutdown pauses
Recovery Target
resume – pg_wal_replay_resume()
set a new target + restart
If the recovery target is not set, the cluster will be restored as close as
possible to the time of failure. However, you can stop the recovery process
at any other point by setting a recovery target.
●
The recovery_target = 'immediate' parameter will stop recovery as soon
as consistency is achieved. This is effectively the same as recovering
from a base backup without using the archive.
●
The recovery_target_name parameter lets you specify a named recovery
point that was previously created using the pg_create_restore_point
function.
●
The recovery_target_time parameter allows you to specify any point in
time (timestamp), recovery_target_xid allows you to specify any
transaction, and recovery_target_lsn allows you to specify an LSN. The
recovery_target_inclusive parameter lets you choose whether to include
or exclude the target point itself.
The recovery_target_action option allows you to select a state in which the
server will be on reaching the target point:
●
`pause` suspends recovery. The administrator can query the data to verify
whether the recovery target was chosen correctly, and then either
complete the recovery by calling the pg_wal_replay_resume function, or
set a new target, restart the server, and continue applying WAL records.
●
With `promote`, the server will immediately be able to accept connection
requests.
●
`shutdown` will stop the server. In this case, the recovery.signal file is not
removed.