Re: Pasword expiration warning
Yuefei Shi <shiyuefei1004@gmail.com>
From: Yuefei Shi <shiyuefei1004@gmail.com>
To: Japin Li <japinli@hotmail.com>
Cc: Gilles Darold <gilles@darold.net>,
songjinzhou <tsinghualucky912@foxmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Andrew Dunstan <andrew@dunslane.net>, "Bossart, Nathan" <bossartn@amazon.com>, Tom Lane <tgl@sss.pgh.pa.us>, liu xiaohui <liuxh.zj.cn@gmail.com>
Date: 2026-01-09T06:10:47Z
Lists: pgsql-hackers
A few review comments for V8.
===
1.
+ if (password_expire_warning > 0 && vuntil < PG_INT64_MAX)
+ {
+ TimestampTz result = (vuntil - now) / USECS_PER_SEC; /* in seconds */
+
+ if (result <= (TimestampTz) password_expire_warning)
+ MyClientConnectionInfo.warning_message =
+ psprintf("your password will expire in %d day(s)", (int)
(result / 86400));
+ }
Please consider localization of the warning message.
2. typo fix
a. `Controls how many time ...` should be `Controls how much time ...`.
b. `Sets how many time before password expire to emit ...` should be
`Sets how much time before password expires to emit ...`
Commits
-
Add password expiration warnings.
- 1d92e0c2cc47 19 (unreleased) landed