{"Entry":{"collection":"guc","key":"hot_standby","name":"hot_standby","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Replication / Standby Servers","category_zh":"","changed_in":["9.1","10"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.4","status":"added","to":"9.0"},{"documentation_changed":false,"fields":{"category":{"from":"Write-Ahead Log / Standby Servers","to":"Replication / Standby Servers"}},"from":"9.0","status":"changed","to":"9.1"},{"documentation_changed":true,"fields":{},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":true,"fields":{"boot_val":{"from":"off","to":"on"}},"from":"9.6","status":"changed","to":"10"},{"documentation_changed":true,"fields":{},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"}],"content_hash":"763102d2121a5a3d9443d594ba4b4e54b8571e3b5e0ab03e004f0da9a7074c4c","context":"","default_changed_in":["10"],"default_history":[{"from":"9.0","to":"9.6","value":"off"},{"from":"10","to":"19","value":"on"}],"editorial":{"advice":{"olap":"Read standbys and logical subscribers often see long queries or large transactions. Put explicit bounds on replay/apply and monitor lag, worker saturation, slot restart_lsn, and conflict cancellations.","oltp":"Size hot_standby from topology, failover roles, slot/subscription count, and reconnect headroom. Test worst-case primary latency, standby replay, and disk retention before production.","small":"Configure only replication capacity that is actually used. Even a small topology needs bounded timeouts and slot lifecycle; unlimited retention is not reliability."},"mechanism":["Allows connections and queries during recovery. The value is fixed when the server starts, so changing it requires a restart.","When recovery has reached a consistent state, this permits read-only connections and queries. Replay still has priority: WAL records that conflict with snapshots or locks can cancel queries according to the standby-delay settings.","Monitor and change hot_standby together with primary_conninfo, primary_slot_name, restore_command. Validate on the relevant server role and real workload, then use its postmaster context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Changing it on the wrong primary, standby, sender, or subscriber role.","Watching only configured bytes/time instead of actual lag, slot position, and worker state.","Failing over to a node that lacks the old primary's capacity or prerequisites.","Using infinite waits or WAL retention to hide a failed consumer."],"references":[{"title":"PostgreSQL 19 Beta 4: hot_standby","url":"https://www.postgresql.org/docs/19/runtime-config-replication.html#GUC-HOT-STANDBY"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["primary_conninfo","primary_slot_name","restore_command","wal_receiver_timeout","wal_retrieve_retry_interval","max_standby_archive_delay"],"summary":"hot_standby — Allows connections and queries during recovery. Observed in PG9.0–19 Beta 4; its last measured boot default is on in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"9.0","group":"Replication","group_slug":"replication","imported_at":"2026-09-27T17:57:31.350629+08:00","intro_commit":{},"key":"hot_standby","last_version":"20","max_val":"","min_val":"","name":"hot_standby","position":166,"present_in":["9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Specifies whether or not you can connect and run queries during recovery, as described in Section 26.4.","short_desc_zh":"","source_rev":"english-manuals:d22a5b7dddd68547b723a64fa1f8e531f49f1f455e2e2353025cab818d1bf9f3","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"hot_standby","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"hot_standby","SourceRevision":"english-manuals:d22a5b7dddd68547b723a64fa1f8e531f49f1f455e2e2353025cab818d1bf9f3","Facts":{"boot_val":"on","category":"Replication / Standby Servers","context":"postmaster","description":"Specifies whether or not you can connect and run queries during recovery, as described in Section 26.4. The default value is on. This parameter can only be set at server start. It only has effect during archive recovery or in standby mode.","doc":{"anchor":"GUC-HOT-STANDBY","file":"runtime-config-replication.html","lang":"en","sha256":"c78480a202f8579e2655e080060afe4859c9eb26a16318fb9099dabb178fb32d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"hot_standby","short_desc":"Allows connections and queries during recovery.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-HOT-STANDBY","file":"runtime-config-replication.html","lang":"en","sha256":"c78480a202f8579e2655e080060afe4859c9eb26a16318fb9099dabb178fb32d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"hot_standby","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"hot_standby","Summary":"","BodyHTML":"\u003cp\u003e指定在恢复期间，你是否能够连接并运行查询，如\u003ca href=\"/docs/18/hot-standby.html\" rel=\"nofollow\"\u003e第 26.4 节\u003c/a\u003e中所述。默认值是\u003ccode\u003eon\u003c/code\u003e。这个参数只能在服务器启动时设置。它只在归档恢复期间或备库模式下才有效。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"555c7442cf52ef44b3d196d5311335b9fa2846e3c0e039be3311c2c7c45128ed","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定在恢复期间，你是否能够连接并运行查询，如\u003ca href=\"/docs/18/hot-standby.html\" title=\"26.4. 热备\"\u003e第 26.4 节\u003c/a\u003e中所述。默认值是\u003ccode class=\"literal\"\u003eon\u003c/code\u003e。这个参数只能在服务器启动时设置。它只在归档恢复期间或备库模式下才有效。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
