Parameter · Write-Ahead Log / Recovery Target
recovery_target
Set to "immediate" to end recovery as soon as a consistent state is reached.
- Default:
'' (empty) - Type: string
- Applies: Restart required
In plain words
During a point-in-time restore, you tell PostgreSQL where to stop replaying WAL. recovery_target = 'immediate' means: stop as soon as the backup is consistent, the earliest possible moment. Useful to get a copy of the database exactly as of the backup.
For DBAs and operators
Only one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set; more than one is an error at startup. Targets apply only to archive recovery (recovery.signal), or on a standby (standby.signal), not to crash recovery.
"Consistent" means replay has passed the point where the base backup ended. The log shows LOG: consistent recovery state reached at 0/5000138LOG: recovery stopping after reaching consistency then what recovery_target_action says.
How to change it
Change in postgresql.conf or ALTER SYSTEM, then restart the server.
See it in context
Related parameters
recovery_target_action recovery_target_time recovery_target_lsn restore_command