{"Entry":{"collection":"guc","key":"recovery_target_lsn","name":"recovery_target_lsn","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Write-Ahead Log / Recovery Target","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"11","status":"added","to":"12"}],"content_hash":"2cd98b9d2de92280f52c861081617e1d5b6958e18ff43d3574b678ac54a8dc1e","context":"","default_changed_in":[],"default_history":[{"from":"12","to":"19","value":"Empty string"}],"derived_content_hash":"3881ab2310de6b0f92aedd21e2c0ae85153354ffdff771a0d4a0704e5bf2ac50","editorial":{"advice":{"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.","oltp":"This is not a steady-state performance knob. Set recovery_target_lsn only on an isolated recovery instance after recording target evidence, base backup, timeline, and expected boundary; rehearse and require a second-person review.","small":"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."},"mechanism":["Sets the LSN of the write-ahead log location up to which recovery will proceed. The value is fixed when the server starts, so changing it requires a restart.","Recovery replays up to a pg_lsn location, with recovery_target_inclusive selecting the side of the boundary. The LSN must lie on the chosen recovery timeline and be reachable from the base backup's WAL chain.","At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, and recovery_target_xid may be set; timeline, inclusive, and action are modifiers. Rehearse from the same base backup through a complete WAL chain—an unreachable target makes targeted recovery fail."],"pitfalls":["Using an LSN from a different cluster or a timeline not descended from the base backup.","Setting another recovery target selector at the same time.","Choosing inclusive without identifying which WAL record must be included.","Requesting an LSN beyond the available archive/streaming WAL and getting an unreachable target.","Comparing LSNs as ordinary decimal numbers instead of pg_lsn values."],"references":[{"title":"PostgreSQL 19 Beta 4: recovery_target_lsn","url":"https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["recovery_target","recovery_target_time","recovery_target_xid","recovery_target_name","recovery_target_inclusive","recovery_target_action"],"summary":"recovery_target_lsn sets the LSN of the write-ahead log location up to which recovery will proceed. It is a postmaster setting present in PG12–18; the latest recorded boot default is empty."},"enumvals":[],"first_version":"12","group":"Write-Ahead Log","group_slug":"wal","imported_at":"2026-09-27T17:57:31.880808+08:00","intro_commit":{"authored_at":"2018-11-25T16:31:16+01:00","discussion":["https://www.postgresql.org/message-id/flat/607741529606767@web3g.yandex.ru/"],"hash":"2dedf4d9a899b36d1a8ed29be5efbd1b31a8fe85","subject":"Integrate recovery.conf into postgresql.conf","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2dedf4d9a899b36d1a8ed29be5efbd1b31a8fe85"},"key":"recovery_target_lsn","last_version":"20","max_val":"","min_val":"","name":"recovery_target_lsn","position":328,"present_in":["12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:d13e3af300a5f2ec7bd4fe870846ded49aa1bf6e4fd6c24320dedabc5ab52cdb","receipt_sha256":"46e9e84dfbe6754c7940d30bbe170efba906f14a13a1113367830454b4473da7","repair":"wiki-repair-20261023"},"short_desc":"This parameter specifies the LSN of the write-ahead log location up to which recovery will proceed.","short_desc_zh":"","source_rev":"wiki-repair-20261023:a3cb3f7b9fd0430300b700e36138a6559230c8eb799cdff8d56f02bc18715a05","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"recovery_target_lsn","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"recovery_target_lsn","SourceRevision":"wiki-repair-20261023:a3cb3f7b9fd0430300b700e36138a6559230c8eb799cdff8d56f02bc18715a05","Facts":{"boot_val":"","category":"Write-Ahead Log / Recovery Target","context":"postmaster","description":"This parameter specifies the LSN of the write-ahead log location up to which recovery will proceed. The precise stopping point is also influenced by recovery_target_inclusive. This parameter is parsed using the system data type pg_lsn.","description_zh":"此参数指定恢复要进行到的预写日志位置的 LSN。精确的停止点也受 recovery_target_inclusive 的影响。使用系统数据类型 pg_lsn 解析此参数。","description_zh_html":"\u003cp\u003e\n        此参数指定恢复要进行到的预写日志位置的 LSN。精确的停止点也受 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-wal.html#GUC-RECOVERY-TARGET-INCLUSIVE\"\u003erecovery_target_inclusive\u003c/a\u003e 的影响。使用系统数据类型 \u003ca class=\"link\" href=\"/zh/docs/18/datatype-pg-lsn.html\" title=\"8.20. pg_lsn 类型\"\u003e\u003ccode class=\"type\"\u003epg_lsn\u003c/code\u003e\u003c/a\u003e 解析此参数。\n       \u003c/p\u003e","doc":{"anchor":"GUC-RECOVERY-TARGET-LSN","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"recovery_target_lsn","short_desc":"Sets the LSN of the write-ahead log location up to which recovery will proceed.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-wal.html","sha256":"94cdacb1171b4c528492ca0aec6aafa48a2c758276225fe0dbfe5b12452d4930"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"string","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-RECOVERY-TARGET-LSN","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"recovery_target_lsn","SourceDatabase":"center","Version":"18","Locale":"en","Title":"recovery_target_lsn","Summary":"This parameter specifies the LSN of the write-ahead log location up to which recovery will proceed. The precise stopping point is also influenced by recovery_target_inclusive. This parameter is parsed using the system data type pg_lsn.","BodyHTML":"\u003cp\u003eThis parameter specifies the LSN of the write-ahead log location up to which recovery will proceed. The precise stopping point is also influenced by recovery_target_inclusive. This parameter is parsed using the system data type pg_lsn.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:a3cb3f7b9fd0430300b700e36138a6559230c8eb799cdff8d56f02bc18715a05","ContentHash":"55a0fff87e56788a66b86c64fde0038f1d5aef6d204023c6fe90963637a91405","Payload":{"description":"This parameter specifies the LSN of the write-ahead log location up to which recovery will proceed. The precise stopping point is also influenced by recovery_target_inclusive. This parameter is parsed using the system data type pg_lsn."}},"RequestedLocale":"en","Fallback":false,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
