{"Entry":{"collection":"guc","key":"tcp_user_timeout","name":"tcp_user_timeout","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Connections and Authentication / TCP Settings","category_zh":"","changed_in":["14","16","18"],"changes":[{"documentation_changed":false,"fields":{},"from":"11","status":"added","to":"12"},{"documentation_changed":false,"fields":{"category":{"from":"Client Connection Defaults / Other Defaults","to":"Connections and Authentication / Connection Settings"}},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{"category":{"from":"Connections and Authentication / Connection Settings","to":"Connections and Authentication / TCP Settings"}},"from":"15","status":"changed","to":"16"},{"documentation_changed":false,"fields":{"extra_desc":{"from":"A value of 0 uses the system default.","to":"0 means use the system default."}},"from":"17","status":"changed","to":"18"}],"content_hash":"95a6d684a8d6d5a826cf99fe8bdb04eff46e2f4fced858d205f83b110fc05ff5","context":"","default_changed_in":[],"default_history":[{"from":"12","to":"19","value":"0 ms"}],"derived_content_hash":"b5b510272c9e22eab2a44e22e8987bb1a1ba4ff9b73c4426ad866f34a096e554","editorial":{"advice":{"olap":"Allow for temporary congestion during large result transfer, but keep the value below the point where an unreachable peer wastes a worker for the rest of the job window.","oltp":"Set tcp_user_timeout from the maximum acceptable unacknowledged-data stall, below the service failover budget and with client retry behavior tested.","small":"Use the operating-system default unless measured half-open connections require a bound; confirm platform support before relying on it."},"mechanism":["tcp_user_timeout sets the TCP user timeout. 0 means use the system default. Where supported, it bounds how long transmitted data may remain unacknowledged before TCP closes the connection; it is distinct from keepalive probing of an idle connection.","tcp_user_timeout is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.","Timeouts overlap: the first applicable deadline wins, while client, pooler, TCP, and server cancellation behavior determines whether work is retried, canceled, or the session is closed."],"pitfalls":["Changing tcp_user_timeout in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.","Forgetting that zero usually disables the timeout or delegates behavior to the operating system.","Setting overlapping deadlines without deciding which layer owns retries, cancellation, and connection disposal.","Confusing unacknowledged-data timeout with keepalive detection for an otherwise idle socket."],"references":[{"title":"PostgreSQL 19 Beta 4: tcp_user_timeout","url":"https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-TCP-USER-TIMEOUT"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["tcp_keepalives_idle","tcp_keepalives_interval","tcp_keepalives_count","client_connection_check_interval","authentication_timeout"],"summary":"tcp_user_timeout is the PostgreSQL setting that defines the TCP user timeout."},"enumvals":[],"first_version":"12","group":"Connections and Authentication","group_slug":"connection","imported_at":"2026-09-27T17:57:32.146836+08:00","intro_commit":{"authored_at":"2019-04-06T15:23:37+09:00","discussion":["https://postgr.es/m/EDA4195584F5064680D8130B1CA91C45367328@G01JPEXMBYT04"],"hash":"249d64999615802752940e017ee5166e726bc7cd","subject":"Add support TCP user timeout in libpq and the backend server","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=249d64999615802752940e017ee5166e726bc7cd"},"key":"tcp_user_timeout","last_version":"20","max_val":"","min_val":"","name":"tcp_user_timeout","position":409,"present_in":["12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:84e88225805425012c9ad2fa99e83c7be3b6de23de6c213356884e1c7ea7359c","receipt_sha256":"39cf07a57b1bbfbfad75adb35f7c23f8f32e0b80196754994945cf6241d88347","repair":"wiki-repair-20261023"},"short_desc":"Specifies the amount of time that transmitted data may remain unacknowledged before the TCP connection is forcibly closed.","short_desc_zh":"","source_rev":"wiki-repair-20261023:6945af6034a9ccbd4acd426ce57248ce923059207cbf83d163724850fbb92a9c","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"tcp_user_timeout","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"tcp_user_timeout","SourceRevision":"wiki-repair-20261023:6945af6034a9ccbd4acd426ce57248ce923059207cbf83d163724850fbb92a9c","Facts":{"boot_val":"0","category":"Connections and Authentication / TCP Settings","context":"user","description":"Specifies the amount of time that transmitted data may remain unacknowledged before the TCP connection is forcibly closed. If this value is specified without units, it is taken as milliseconds. A value of 0 (the default) selects the operating system's default. This parameter is supported only on systems that support TCP_USER_TIMEOUT (which does not include Windows); on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero.","description_zh":"指定已发送的数据在 TCP 连接被强制关闭之前最多可以保持未确认状态多长时间。如果指定值时没有单位，则以毫秒为单位。值 0（默认值）表示选择操作系统默认值。这个参数只在支持 TCP_USER_TIMEOUT 的系统上受支持（不包括 Windows）；在其他系统上，它必须为零。在通过 Unix 域套接字连接的会话中，此参数会被忽略，并始终读作零。","description_zh_html":"\u003cp\u003e\n        指定已发送的数据在 TCP 连接被强制关闭之前最多可以保持未确认状态多长时间。如果指定值时没有单位，则以毫秒为单位。值 \u003ccode class=\"literal\"\u003e0\u003c/code\u003e（默认值）表示选择操作系统默认值。这个参数只在支持 \u003ccode class=\"symbol\"\u003eTCP_USER_TIMEOUT\u003c/code\u003e 的系统上受支持（不包括 Windows）；在其他系统上，它必须为零。在通过 Unix 域套接字连接的会话中，此参数会被忽略，并始终读作零。\n       \u003c/p\u003e","doc":{"anchor":"GUC-TCP-USER-TIMEOUT","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"0 means use the system default.","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"tcp_user_timeout","short_desc":"TCP user timeout.","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":"ms","vartype":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-TCP-USER-TIMEOUT","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"tcp_user_timeout","SourceDatabase":"center","Version":"18","Locale":"en","Title":"tcp_user_timeout","Summary":"Specifies the amount of time that transmitted data may remain unacknowledged before the TCP connection is forcibly closed. If this value is specified without units, it is taken as milliseconds. A value of 0 (the default) selects the operating system's default. This parameter is supported only on systems that support TCP_USER_TIMEOUT (which does not include Windows); on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero.","BodyHTML":"\u003cp\u003eSpecifies the amount of time that transmitted data may remain unacknowledged before the TCP connection is forcibly closed. If this value is specified without units, it is taken as milliseconds. A value of 0 (the default) selects the operating system\u0026#39;s default. This parameter is supported only on systems that support TCP_USER_TIMEOUT (which does not include Windows); on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:6945af6034a9ccbd4acd426ce57248ce923059207cbf83d163724850fbb92a9c","ContentHash":"175f121d085cc643e82d142d02f1d2ae0945335ce5e6171aa6a8e0f11ea597e4","Payload":{"description":"Specifies the amount of time that transmitted data may remain unacknowledged before the TCP connection is forcibly closed. If this value is specified without units, it is taken as milliseconds. A value of 0 (the default) selects the operating system's default. This parameter is supported only on systems that support TCP_USER_TIMEOUT (which does not include Windows); on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero."}},"RequestedLocale":"en","Fallback":false,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
