Parameter · Write-Ahead Log / Recovery Target
recovery_target_lsn
Sets the LSN of the write-ahead log location up to which recovery will proceed.
- Default:
'' (empty) - Type: string
- Applies: Restart required
In plain words
The most precise target: stop at an exact position in the WAL (a log sequence number like 0/5003F80). Useful when you located the bad record with pg_waldump.
For DBAs and operators
Unlike time and XID targets, an LSN target can stop at any record, not only at commits. With recovery_target_inclusive = on replay stops just after the record at that LSN; with off, just before. Find candidate LSNs with pg_waldump, or record them before risky operations with SELECT pg_current_wal_lsn();.
LOG: recovery stopping before WAL location (LSN) "0/5003F80"
How to change it
Change in postgresql.conf or ALTER SYSTEM, then restart the server.
See it in context
Related parameters
recovery_target_inclusive recovery_target_name recovery_target_action