{"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"}],"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"],"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":"english-manuals:aa3c0638ec9b81453a41c08cc249aceab336eae40164c45ef5009ba56c3341b0","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"reserved_connections","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"reserved_connections","SourceRevision":"english-manuals:aa3c0638ec9b81453a41c08cc249aceab336eae40164c45ef5009ba56c3341b0","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.","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","unit":null,"vartype":"integer"},"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":"pgweb","Version":"18","Locale":"zh-Hans","Title":"reserved_connections","Summary":"","BodyHTML":"\u003cp\u003e确定为具有 \u003ca href=\"/docs/18/predefined-roles.html#PREDEFINED-ROLE-PG-USE-RESERVED-CONNECTIONS\" rel=\"nofollow\"\u003e\u003ccode\u003epg_use_reserved_connections\u003c/code\u003e\u003c/a\u003e 角色权限的角色保留多少个连接\u003cspan\u003e“\u003cspan\u003e槽\u003c/span\u003e”\u003c/span\u003e。当空闲连接槽的数量大于\u003ca href=\"/docs/18/runtime-config-connection.html#GUC-SUPERUSER-RESERVED-CONNECTIONS\" rel=\"nofollow\"\u003esuperuser_reserved_connections\u003c/a\u003e，但小于或等于 \u003ccode\u003esuperuser_reserved_connections\u003c/code\u003e 与 \u003ccode\u003ereserved_connections\u003c/code\u003e 之和时，新连接将只接受超级用户以及具有 \u003ccode\u003epg_use_reserved_connections\u003c/code\u003e 角色权限的角色。如果可用连接槽的数量小于或等于 \u003ccode\u003esuperuser_reserved_connections\u003c/code\u003e，则新连接只接受超级用户。\u003c/p\u003e\u003cp\u003e默认值为零个连接。该值必须小于 \u003ccode\u003emax_connections\u003c/code\u003e 减去 \u003ccode\u003esuperuser_reserved_connections\u003c/code\u003e。此参数只能在服务器启动时设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"3fe48f99838e8ef6b9d2b221d717bc022a64a6e95f672b5cf3b6302f1f764230","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e确定为具有 \u003ca href=\"/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 href=\"/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，则新连接只接受超级用户。\u003c/p\u003e\u003cp\u003e默认值为零个连接。该值必须小于 \u003ccode class=\"varname\"\u003emax_connections\u003c/code\u003e 减去 \u003ccode class=\"varname\"\u003esuperuser_reserved_connections\u003c/code\u003e。此参数只能在服务器启动时设置。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
