{"Entry":{"collection":"guc","key":"primary_slot_name","name":"primary_slot_name","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Replication / Standby Servers","category_zh":"","changed_in":["13"],"changes":[{"documentation_changed":false,"fields":{},"from":"11","status":"added","to":"12"},{"documentation_changed":true,"fields":{"context":{"from":"postmaster","to":"sighup"}},"from":"12","status":"changed","to":"13"},{"documentation_changed":true,"fields":{},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":true,"fields":{},"from":"18","status":"changed","to":"19"}],"content_hash":"7a4d28f8b73aa4c24e3e894204d5d46b770a1249cd0f70031c190b341599c37a","context":"","default_changed_in":[],"default_history":[{"from":"12","to":"19","value":"Empty string"}],"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 primary_slot_name 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":["Sets the name of the replication slot to use on the sending server. A configuration reload applies a new value; existing work already in flight is not retroactively changed.","The receiver names an existing upstream physical slot so the sender retains WAL needed by this standby. It improves continuity across disconnects but transfers disk-retention risk to the primary and must match slot lifecycle during failover.","Monitor and change primary_slot_name together with wal_keep_segments, wal_keep_size, wal_segment_size. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Creating a slot without monitoring restart_lsn and primary disk usage.","Dropping or reusing the slot during failover without proving consumer position.","Assuming a slot alone archives or backs up WAL.","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."],"references":[{"title":"PostgreSQL 19 Beta 4: primary_slot_name","url":"https://www.postgresql.org/docs/19/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["wal_keep_segments","wal_keep_size","wal_segment_size","max_slot_wal_keep_size","max_wal_size","idle_replication_slot_timeout"],"summary":"primary_slot_name sets the name of the replication slot to use on the sending server. It is a sighup setting present in PG12–18; the latest recorded boot default is empty."},"enumvals":[],"first_version":"12","group":"Replication","group_slug":"replication","imported_at":"2026-09-27T17:57:31.846817+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":"primary_slot_name","last_version":"20","max_val":"","min_val":"","name":"primary_slot_name","position":317,"present_in":["12","13","14","15","16","17","18","19","20"],"short_desc":"Optionally specifies an existing replication slot to be used when connecting to the sending server via streaming replication to control resource removal on the upstream node (see Section 26.2.6).","short_desc_zh":"","source_rev":"english-manuals:94fbe251acd76666ff64736df681bcaa81181040a82bffde27c2773e858aad09","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"primary_slot_name","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"primary_slot_name","SourceRevision":"english-manuals:94fbe251acd76666ff64736df681bcaa81181040a82bffde27c2773e858aad09","Facts":{"boot_val":"","category":"Replication / Standby Servers","context":"sighup","description":"Optionally specifies an existing replication slot to be used when connecting to the sending server via streaming replication to control resource removal on the upstream node (see Section 26.2.6). This parameter can only be set in the postgresql.conf file or on the server command line. If this parameter is changed while the WAL receiver process is running, that process is signaled to shut down and expected to restart with the new setting. This setting has no effect if primary_conninfo is not set or the server is not in standby mode.","doc":{"anchor":"GUC-PRIMARY-SLOT-NAME","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":"primary_slot_name","short_desc":"Sets the name of the replication slot to use on the sending server.","source":"pg-settings-source-snapshot","unit":null,"vartype":"string"},"ManualEvidence":{"doc":{"anchor":"GUC-PRIMARY-SLOT-NAME","file":"runtime-config-replication.html","lang":"en","sha256":"c78480a202f8579e2655e080060afe4859c9eb26a16318fb9099dabb178fb32d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"primary_slot_name","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"primary_slot_name","Summary":"","BodyHTML":"\u003cp\u003e可选地指定通过流复制连接到发送服务器时使用一个现有的复制槽来控制上游节点上的资源移除（见\u003ca href=\"/docs/18/warm-standby.html#STREAMING-REPLICATION-SLOTS\" rel=\"nofollow\"\u003e第 26.2.6 节\u003c/a\u003e）。这个参数只能在 \u003ccode\u003epostgresql.conf\u003c/code\u003e文件或服务器命令行上设置。如果在 WAL 接收进程运行时更改此参数，则会向该进程发送关闭信号，并预期它使用新设置重新启动。如果没有设置\u003ccode\u003eprimary_conninfo\u003c/code\u003e或服务器没有处于备库模式，则此设置无效。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"38b0d867615443418f1a51f8bf6132cb1d21dc8c80ca8e05d4953d8285893476","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e可选地指定通过流复制连接到发送服务器时使用一个现有的复制槽来控制上游节点上的资源移除（见\u003ca href=\"/docs/18/warm-standby.html#STREAMING-REPLICATION-SLOTS\" title=\"26.2.6. 复制槽\"\u003e第 26.2.6 节\u003c/a\u003e）。这个参数只能在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e文件或服务器命令行上设置。如果在 WAL 接收进程运行时更改此参数，则会向该进程发送关闭信号，并预期它使用新设置重新启动。如果没有设置\u003ccode class=\"varname\"\u003eprimary_conninfo\u003c/code\u003e或服务器没有处于备库模式，则此设置无效。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
