{"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"}],"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"],"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":"english-manuals:84e88225805425012c9ad2fa99e83c7be3b6de23de6c213356884e1c7ea7359c","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"tcp_user_timeout","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"tcp_user_timeout","SourceRevision":"english-manuals:84e88225805425012c9ad2fa99e83c7be3b6de23de6c213356884e1c7ea7359c","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.","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","unit":"ms","vartype":"integer"},"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":"english-manuals:84e88225805425012c9ad2fa99e83c7be3b6de23de6c213356884e1c7ea7359c","ContentHash":"6475a85a82c933f421f6a0e7aa70eef26229edc9b70890d6ac3e9c2f6191916c","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":"zh-Hans","Fallback":true,"Versions":["12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
