{"Entry":{"collection":"guc","key":"password_expiration_warning_threshold","name":"password_expiration_warning_threshold","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Connections and Authentication / Authentication","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"18","status":"added","to":"19"}],"content_hash":"33513471337fa7c7acbbde2f8153028b2dac7f7cb106278b2236c0280244e1bb","context":"","default_changed_in":[],"default_history":[{"from":"19","to":"19","value":"7 d"}],"derived_content_hash":"caf8546185c9ffa486a5095eb981eef63fb57d0534bf93de6add471dbea0cca9","editorial":{"advice":{"olap":"Apply the same security policy to batch drivers and long-lived ETL connections. Test clients that omit SNI, credential-expiry automation, reload behavior, and certificate-chain compatibility.","oltp":"Roll out through staged clients, validate certificate selection and expiry warnings, and monitor authentication failures. Keep a tested fallback and treat file permissions and secret rotation as part of the same change.","small":"Prefer a simple, documented TLS and credential policy. Do not enable multi-certificate routing without a test for every hostname and fallback path, and never weaken verification to hide configuration mistakes."},"mechanism":["PostgreSQL describes password_expiration_warning_threshold as follows: “Threshold for password expiration warnings.” A configuration reload applies the value to the server without a full restart. The atlas measures it in PG19 Beta 3; boot_val is the compiled or initialized baseline, not proof of a running cluster's effective setting.","After successful password authentication, PostgreSQL warns when a role with VALID UNTIL has less than this interval remaining. Zero disables the warning; the default seven-day window is advisory and does not create, rotate, or extend credentials, and non-password authentication does not make password expiry management automatic.","Read it together with password_encryption, authentication_timeout, md5_password_warnings, hba_file. Check SHOW and pg_settings on the target server, verify the source and pending_restart fields, and compare workload, logs, and resource metrics before and after any change."],"pitfalls":["Treating the measured boot_val for password_expiration_warning_threshold as proof of the effective value on an initialized or managed cluster.","Applying a change as though it were immediate while pg_settings reports sighup context.","Changing this setting in isolation without checking the linked limits, observability, and rollback path.","Depending on beta behavior in production without retesting the PostgreSQL 19 final release."],"references":[{"title":"PostgreSQL 19 Beta 4: password_expiration_warning_threshold","url":"https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-PASSWORD-EXPIRATION-WARNING-THRESHOLD"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["password_encryption","authentication_timeout","md5_password_warnings","hba_file"],"summary":"password_expiration_warning_threshold — Threshold for password expiration warnings. Observed in PG19 Beta 4; its last measured boot default is 7 d in PG19 Beta 4, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"19","group":"Connections and Authentication","group_slug":"connection","imported_at":"2026-09-27T17:57:31.82517+08:00","intro_commit":{"authored_at":"2026-02-11T10:36:15-06:00","discussion":["https://postgr.es/m/129bcfbf-47a6-e58a-190a-62fc21a17d03%40migops.com"],"hash":"1d92e0c2cc4789255c630d8776bbe85ca9ebc27f","subject":"Add password expiration warnings.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1d92e0c2cc4789255c630d8776bbe85ca9ebc27f"},"key":"password_expiration_warning_threshold","last_version":"20","max_val":"","min_val":"","name":"password_expiration_warning_threshold","position":310,"present_in":["19","20"],"repair_provenance":{"original_source_revision":"english-manuals:8f1b9a99bd6e711fc64f127489fb83290bc2fdd2f760df9e7da8b540c3517aec","receipt_sha256":"cf7510ba6bf37c921ec3a187bab12ac12fe10c2130a2fa64b22d8845eb7b13e7","repair":"wiki-repair-20261023"},"short_desc":"When this parameter is greater than zero, the server will emit a WARNING upon successful password authentication if less than this amount of time remains until the authenticated role's password expires.","short_desc_zh":"","source_rev":"wiki-repair-20261023:d3178e0dce091908018cedd89a798145840bad256d9460c5fbbd16c9f8cc7a0f","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"password_expiration_warning_threshold","SourceDatabase":"center","Version":"19","SourceTable":"guc","SourceKey":"password_expiration_warning_threshold","SourceRevision":"wiki-repair-20261023:d3178e0dce091908018cedd89a798145840bad256d9460c5fbbd16c9f8cc7a0f","Facts":{"boot_val":"604800","category":"Connections and Authentication / Authentication","context":"sighup","description":"When this parameter is greater than zero, the server will emit a WARNING upon successful password authentication if less than this amount of time remains until the authenticated role's password expires. Note that a role's password only expires if a date was specified in a VALID UNTIL clause for CREATE ROLE or ALTER ROLE. If this value is specified without units, it is taken as seconds. The default is 7 days. This parameter can only be set in the postgresql.conf file or on the server command line.","description_zh":"当此参数大于零时，如果距离已认证角色的密码过期剩余时间少于这个时长，服务器会在成功完成密码认证后发出 WARNING。注意只有在 CREATE ROLE 或 ALTER ROLE 的 VALID UNTIL 子句中指定了日期时，角色密码才会过期。如果不带单位指定此值，则按秒计。默认值为 7 天。此参数只能在 postgresql.conf 文件中或者服务器命令行上设置。","description_zh_html":"\u003cp\u003e\n        当此参数大于零时，如果距离已认证角色的密码过期剩余时间少于这个时长，服务器会在成功完成密码认证后发出 \u003ccode class=\"literal\"\u003eWARNING\u003c/code\u003e。注意只有在 \u003ccode class=\"command\"\u003eCREATE ROLE\u003c/code\u003e 或 \u003ccode class=\"command\"\u003eALTER ROLE\u003c/code\u003e 的 \u003ccode class=\"literal\"\u003eVALID UNTIL\u003c/code\u003e 子句中指定了日期时，角色密码才会过期。如果不带单位指定此值，则按秒计。默认值为 7 天。此参数只能在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e 文件中或者服务器命令行上设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-PASSWORD-EXPIRATION-WARNING-THRESHOLD","file":"runtime-config-connection.html","lang":"en","sha256":"16e7573642eca907e42ae1cdd3548ca1bc07e3e0388918f565676b4fdece8161","slug":"19"},"documented":true,"enumvals":null,"extra_desc":"0 disables these warnings.","lang":"en","max_val":"2147483647","metadata_version":"19beta4","min_val":"0","name":"password_expiration_warning_threshold","short_desc":"Threshold for password expiration warnings.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/19/html/runtime-config-connection.html","sha256":"343d537f9dd9e9f40dfcd768d87fedc608c6a78fa7b079ef8424f79d969a9bd0"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"19"},"unit":"s","vartype":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-PASSWORD-EXPIRATION-WARNING-THRESHOLD","file":"runtime-config-connection.html","lang":"en","sha256":"16e7573642eca907e42ae1cdd3548ca1bc07e3e0388918f565676b4fdece8161","slug":"19"}},"MeasuredEvidence":{"metadata_version":"19beta4"}},"Text":{"Collection":"guc","Key":"password_expiration_warning_threshold","SourceDatabase":"center","Version":"19","Locale":"en","Title":"password_expiration_warning_threshold","Summary":"When this parameter is greater than zero, the server will emit a WARNING upon successful password authentication if less than this amount of time remains until the authenticated role's password expires. Note that a role's password only expires if a date was specified in a VALID UNTIL clause for CREATE ROLE or ALTER ROLE. If this value is specified without units, it is taken as seconds. The default is 7 days. This parameter can only be set in the postgresql.conf file or on the server command line.","BodyHTML":"\u003cp\u003eWhen this parameter is greater than zero, the server will emit a WARNING upon successful password authentication if less than this amount of time remains until the authenticated role\u0026#39;s password expires. Note that a role\u0026#39;s password only expires if a date was specified in a VALID UNTIL clause for CREATE ROLE or ALTER ROLE. If this value is specified without units, it is taken as seconds. The default is 7 days. This parameter can only be set in the postgresql.conf file or on the server command line.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:d3178e0dce091908018cedd89a798145840bad256d9460c5fbbd16c9f8cc7a0f","ContentHash":"347044120da2a20e94276440a73d45e0e7d7e0157940fa1d2aab97bca616b00f","Payload":{"description":"When this parameter is greater than zero, the server will emit a WARNING upon successful password authentication if less than this amount of time remains until the authenticated role's password expires. Note that a role's password only expires if a date was specified in a VALID UNTIL clause for CREATE ROLE or ALTER ROLE. If this value is specified without units, it is taken as seconds. The default is 7 days. This parameter can only be set in the postgresql.conf file or on the server command line."}},"RequestedLocale":"en","Fallback":false,"Versions":["19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
