{"Entry":{"collection":"guc","key":"reserved_connections","name":"reserved_connections","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Connections and Authentication / Connection Settings","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"15","status":"added","to":"16"}],"content_hash":"060b92ae03399dca4861d3615ebdf7b225d28fc221a7014dc22852ee95df96db","context":"","default_changed_in":[],"default_history":[{"from":"16","to":"19","value":"0"}],"derived_content_hash":"7c51bcbf019733cf8bc5d88b253275383a0d2edb34964383914ce902496605eb","editorial":{"advice":{"olap":"Reserve enough slots for control, monitoring, and cancellation around heavy analytical sessions, but do not let reserves consume an excessive share of a deliberately small backend pool.","oltp":"Size reserved_connections inside max_connections from the number of independent emergency actors, pooler behavior, and failover operations. Test that ordinary saturation still leaves usable administrative access.","small":"Keep reserved_connections modest relative to max_connections while preserving at least one tested emergency path; reserved slots are capacity unavailable to ordinary clients at saturation."},"mechanism":["reserved_connections sets the number of connection slots reserved for roles with privileges of pg_use_reserved_connections. These slots become available only to roles granted pg_use_reserved_connections and sit above ordinary capacity but below superuser-only reserves.","reserved_connections is a POSTMASTER-context setting: PostgreSQL reads it during server startup, and a configuration reload or session SET cannot activate a new value.","reserved_connections and superuser_reserved_connections carve privileged tiers from max_connections; poolers, monitoring, replication, maintenance, and failover must all fit the same total backend budget."],"pitfalls":["Expecting a reload or SET to activate reserved_connections, although it requires a controlled server restart.","Counting reserved slots outside max_connections even though every tier consumes the same total ceiling.","Reserving too little for incident response or so much that ordinary application capacity collapses at saturation.","Sizing ordinary, reserved, and superuser-reserved slots without ensuring their sum fits max_connections."],"references":[{"title":"PostgreSQL 19 Beta 4: reserved_connections","url":"https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-RESERVED-CONNECTIONS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["listen_addresses","port","max_connections","superuser_reserved_connections","unix_socket_directories"],"summary":"reserved_connections is the PostgreSQL setting that defines the number of connection slots reserved for roles with privileges of pg_use_reserved_connections."},"enumvals":[],"first_version":"16","group":"Connections and Authentication","group_slug":"connection","imported_at":"2026-09-27T17:57:31.907756+08:00","intro_commit":{"authored_at":"2023-01-20T15:36:36-05:00","discussion":["https://postgr.es/m/20230119194601.GA4105788@nathanxps13"],"hash":"6e2775e4d4e47775f0d933e4a93c148024a3bc63","subject":"Add new GUC reserved_connections.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6e2775e4d4e47775f0d933e4a93c148024a3bc63"},"key":"reserved_connections","last_version":"20","max_val":"","min_val":"","name":"reserved_connections","position":340,"present_in":["16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:aa3c0638ec9b81453a41c08cc249aceab336eae40164c45ef5009ba56c3341b0","receipt_sha256":"fa241efe0a977d3888a5618fab2b1843c9035ba8dbbbee5d3a76241e64e4f99f","repair":"wiki-repair-20261023"},"short_desc":"Determines the number of connection “slots” that are reserved for connections by roles with privileges of the pg_use_reserved_connections role.","short_desc_zh":"","source_rev":"wiki-repair-20261023:a1daf7be77814b6c8f3587a2fb2b40bf21e3ffc5ed8a44999bdf6c79abc8a975","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"reserved_connections","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"reserved_connections","SourceRevision":"wiki-repair-20261023:a1daf7be77814b6c8f3587a2fb2b40bf21e3ffc5ed8a44999bdf6c79abc8a975","Facts":{"boot_val":"0","category":"Connections and Authentication / Connection Settings","context":"postmaster","description":"Determines the number of connection “slots” that are reserved for connections by roles with privileges of the pg_use_reserved_connections role. Whenever the number of free connection slots is greater than superuser_reserved_connections but less than or equal to the sum of superuser_reserved_connections and reserved_connections, new connections will be accepted only for superusers and roles with privileges of pg_use_reserved_connections. If superuser_reserved_connections or fewer connection slots are available, new connections will be accepted only for superusers. The default value is zero connections. The value must be less than max_connections minus superuser_reserved_connections. This parameter can only be set at server start.","description_zh":"确定为具有 pg_use_reserved_connections 角色权限的角色保留多少个连接“槽”。当空闲连接槽的数量大于 superuser_reserved_connections，但小于或等于 superuser_reserved_connections 与 reserved_connections 之和时，新连接将只接受超级用户以及具有 pg_use_reserved_connections 角色权限的角色。如果可用连接槽的数量小于或等于 superuser_reserved_connections，则新连接只接受超级用户。 默认值为零个连接。该值必须小于 max_connections 减去 superuser_reserved_connections。此参数只能在服务器启动时设置。","description_zh_html":"\u003cp\u003e\n        确定为具有 \u003ca class=\"link\" href=\"/zh/docs/18/predefined-roles.html#PREDEFINED-ROLE-PG-USE-RESERVED-CONNECTIONS\"\u003e\u003ccode class=\"literal\"\u003epg_use_reserved_connections\u003c/code\u003e\u003c/a\u003e 角色权限的角色保留多少个连接\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e槽\u003c/span\u003e”\u003c/span\u003e。当空闲连接槽的数量大于 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-connection.html#GUC-SUPERUSER-RESERVED-CONNECTIONS\"\u003esuperuser_reserved_connections\u003c/a\u003e，但小于或等于 \u003ccode class=\"varname\"\u003esuperuser_reserved_connections\u003c/code\u003e 与 \u003ccode class=\"varname\"\u003ereserved_connections\u003c/code\u003e 之和时，新连接将只接受超级用户以及具有 \u003ccode class=\"literal\"\u003epg_use_reserved_connections\u003c/code\u003e 角色权限的角色。如果可用连接槽的数量小于或等于 \u003ccode class=\"varname\"\u003esuperuser_reserved_connections\u003c/code\u003e，则新连接只接受超级用户。\n       \u003c/p\u003e\u003cp\u003e\n        默认值为零个连接。该值必须小于 \u003ccode class=\"varname\"\u003emax_connections\u003c/code\u003e 减去 \u003ccode class=\"varname\"\u003esuperuser_reserved_connections\u003c/code\u003e。此参数只能在服务器启动时设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-RESERVED-CONNECTIONS","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"262143","metadata_version":"18","min_val":"0","name":"reserved_connections","short_desc":"Sets the number of connection slots reserved for roles with privileges of pg_use_reserved_connections.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-connection.html","sha256":"f4e5e4debc927cfa154bbdd71f3bf2eda8130ac3acace1109fe7d45ef2a3456b"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-RESERVED-CONNECTIONS","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"reserved_connections","SourceDatabase":"center","Version":"18","Locale":"en","Title":"reserved_connections","Summary":"Determines the number of connection “slots” that are reserved for connections by roles with privileges of the pg_use_reserved_connections role. Whenever the number of free connection slots is greater than superuser_reserved_connections but less than or equal to the sum of superuser_reserved_connections and reserved_connections, new connections will be accepted only for superusers and roles with privileges of pg_use_reserved_connections. If superuser_reserved_connections or fewer connection slots are available, new connections will be accepted only for superusers. The default value is zero connections. The value must be less than max_connections minus superuser_reserved_connections. This parameter can only be set at server start.","BodyHTML":"\u003cp\u003eDetermines the number of connection “slots” that are reserved for connections by roles with privileges of the pg_use_reserved_connections role. Whenever the number of free connection slots is greater than superuser_reserved_connections but less than or equal to the sum of superuser_reserved_connections and reserved_connections, new connections will be accepted only for superusers and roles with privileges of pg_use_reserved_connections. If superuser_reserved_connections or fewer connection slots are available, new connections will be accepted only for superusers. The default value is zero connections. The value must be less than max_connections minus superuser_reserved_connections. This parameter can only be set at server start.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:a1daf7be77814b6c8f3587a2fb2b40bf21e3ffc5ed8a44999bdf6c79abc8a975","ContentHash":"ffb5c0e4394c5b8514707acde91966e2b5d7522c954210c69e3ab691cf0fe2ad","Payload":{"description":"Determines the number of connection “slots” that are reserved for connections by roles with privileges of the pg_use_reserved_connections role. Whenever the number of free connection slots is greater than superuser_reserved_connections but less than or equal to the sum of superuser_reserved_connections and reserved_connections, new connections will be accepted only for superusers and roles with privileges of pg_use_reserved_connections. If superuser_reserved_connections or fewer connection slots are available, new connections will be accepted only for superusers. The default value is zero connections. The value must be less than max_connections minus superuser_reserved_connections. This parameter can only be set at server start."}},"RequestedLocale":"en","Fallback":false,"Versions":["16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
