{"Entry":{"collection":"guc","key":"recovery_target","name":"recovery_target","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":"100d095a3db2b2fc6b93d59b7fcb80e464db88f268ba67e527f7f1dc42782a9f","context":"","default_changed_in":[],"default_history":[{"from":"12","to":"19","value":"Empty string"}],"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 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":["Set to \"immediate\" to end recovery as soon as a consistent state is reached. The value is fixed when the server starts, so changing it requires a restart.","The only accepted value is immediate, which stops targeted recovery at the first consistent point—normally the end of an online base backup. It is mutually exclusive with the LSN, name, time, and XID target selectors.","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":["Setting immediate together with an LSN, name, time, or XID selector.","Confusing the first consistent point after an online backup with the desired business recovery point.","Leaving immediate in a normal standby configuration and ending recovery unexpectedly.","Starting without recovery.signal and assuming the target will control crash recovery.","Assuming success when the required WAL chain never reaches a consistent point."],"references":[{"title":"PostgreSQL 19 Beta 4: recovery_target","url":"https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-RECOVERY-TARGET"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["recovery_target_time","recovery_target_xid","recovery_target_lsn","recovery_target_name","recovery_target_inclusive","recovery_target_action"],"summary":"recovery_target can be set to \"immediate\" to end recovery as soon as a consistent state is reached. 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.872363+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","last_version":"20","max_val":"","min_val":"","name":"recovery_target","position":325,"present_in":["12","13","14","15","16","17","18","19","20"],"short_desc":"This parameter specifies that recovery should end as soon as a consistent state is reached, i.e., as early as possible.","short_desc_zh":"","source_rev":"english-manuals:06028e99027d7bfbd3332ad17367cd0568c8d1bce800432c32d989c61f139257","unit":"","vartype":""}},"Definition":{"Collection":"guc","Key":"recovery_target","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"recovery_target","SourceRevision":"english-manuals:06028e99027d7bfbd3332ad17367cd0568c8d1bce800432c32d989c61f139257","Facts":{"boot_val":"","category":"Write-Ahead Log / Recovery Target","context":"postmaster","description":"This parameter specifies that recovery should end as soon as a consistent state is reached, i.e., as early as possible. When restoring from an online backup, this means the point where taking the backup ended. Technically, this is a string parameter, but 'immediate' is currently the only allowed value.","doc":{"anchor":"GUC-RECOVERY-TARGET","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","short_desc":"Set to \"immediate\" to end recovery as soon as a consistent state is reached.","source":"pg-settings-source-snapshot","unit":null,"vartype":"string"},"ManualEvidence":{"doc":{"anchor":"GUC-RECOVERY-TARGET","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"recovery_target","SourceDatabase":"center","Version":"18","Locale":"en","Title":"recovery_target","Summary":"This parameter specifies that recovery should end as soon as a consistent state is reached, i.e., as early as possible. When restoring from an online backup, this means the point where taking the backup ended. Technically, this is a string parameter, but 'immediate' is currently the only allowed value.","BodyHTML":"\u003cp\u003eThis parameter specifies that recovery should end as soon as a consistent state is reached, i.e., as early as possible. When restoring from an online backup, this means the point where taking the backup ended. Technically, this is a string parameter, but \u0026#39;immediate\u0026#39; is currently the only allowed value.\u003c/p\u003e","SourceRevision":"english-manuals:06028e99027d7bfbd3332ad17367cd0568c8d1bce800432c32d989c61f139257","ContentHash":"605048744c3eabfba6a9b129dcf9f2f80a81bba7e821e1c18d85f7951bdbe17d","Payload":{"description":"This parameter specifies that recovery should end as soon as a consistent state is reached, i.e., as early as possible. When restoring from an online backup, this means the point where taking the backup ended. Technically, this is a string parameter, but 'immediate' is currently the only allowed value."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
