Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ve5iI-008kEx-2B for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Jan 2026 06:11:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1ve5iG-005td1-1U for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Jan 2026 06:11:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ve5iG-005tct-0R for pgsql-hackers@lists.postgresql.org; Fri, 09 Jan 2026 06:11:08 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ve5iB-005QAQ-0n for pgsql-hackers@postgresql.org; Fri, 09 Jan 2026 06:11:08 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-455dc1cf59aso2400562b6e.0 for ; Thu, 08 Jan 2026 22:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767939060; x=1768543860; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5FrYCtXPRC9jxLdMWfk+XUwNWd7c7ycT0rC4EtVDzTk=; b=BuI1V9HLUSDphCQJmO+gdpT6wFiGNCehRd91TzXF2VPPqQJ6LELGjUotHRTfIusGQ5 acnmhwb7iEZqadtMp2bUk5r9c/oa6ddkySt5q7M5gcO0dNUAYSKeXRugUFjeCTCKelWv skLXlMiv3WPxqEGxr+ClYovQnCsgwn5bU9dVTBFsbg6WmJUQ1lhczrvblH5b7nOB4Cuy zGp3Ejp6U0ug6qXdNnAt/BCm0SUyXcqaqVtvFR6mFyfMrGSeBODNy9b1e3v5VQDyP1F4 mt8O+XO28VRZP/Fmp4uq7xSbiNdtcjZY7d67LoWQT6nhTAbaFEPN5qeHIZkaiP979TQk RAFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767939060; x=1768543860; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5FrYCtXPRC9jxLdMWfk+XUwNWd7c7ycT0rC4EtVDzTk=; b=cQbOEPHktqyU/tOXfzzRzvaaJTj1KOBLAtpOX8pPXqUCX5z2+8iWHkbj4qb8x1cfFr rVvSMyIcbPEoXs9LI0+oxXPz92QC3zIpVNmBwzs8iBt9JYODj4yumdVvaVQlC5IAwFii Oc8yVM0kQqIhRe8VYpOk+Pdm0bz+rXrdC9nOo9UfiXW2DNM7gvxMjdRFle6kCU25uNeS dpmIRjAbrRzDp9XsWAn96tJkvEyY6p7rsKqSOZ5AwCuoT0HD3MAVxbMf78KWoGTPlWPQ tXEhJ3cSdtnxth0dFp/pwOW+0aLCjCDgt86e/1733NBoNjcqMab+BT4nAxRjUES2okk3 ZOWw== X-Forwarded-Encrypted: i=1; AJvYcCWpJpXqdvuN4+JCkiVteSI9yn1qQK9lYt4VWJA9dTk58CWXAFYirovnj+5v4xqMgPkwwSUjmUUYYM1iDHZY@postgresql.org X-Gm-Message-State: AOJu0YyuNvdrOCHjvU43BmZbs/f1pBcUpDtpfA+YhslbToTQOnXZ449e xYRpkpXbe5W3NLwGcCDtpFHK06Gjgf723cAqYbhC0o7ZBfNsI2ukqNXQfhY/nrwZk5DZhnnAP1l 3FeYG0eqyTpXalfFxYi7ygYQiVOlZRE8= X-Gm-Gg: AY/fxX6+trQ7HJ6oGXtK5ehm9+cY4GCKc/6HwfbsPK7C2XnhOcnUfHLUbMEt0VsjAsJ qnGbUTNKDXP2EEQpwcB1LwAofJV6sTiu2uWWSTiH3o9H3ee4zi4MlOS2KYv0zCiCs9idu+7WN9o PsUTDqjs5BAxpNh6Rs4SK7Vlx7QDdUMAUbJHbltDjcjzy+Zg3f9vdJ41HHN6AMxp+C9jBQv1wtz zbvi1i9PJK7hvVhFiLgKime/i4gQcCj/VqIEg95ofzmEf5VERxvS+2OIAy6wX/GfjUbtVhP X-Google-Smtp-Source: AGHT+IGiFp58tb1WPv2RckZu2P6m1tXc9zpTJ89/rvu+vL/7h1xgV8drn+IA5+6+yLKzTI2lrgKTHPyhw7WMPjM+rhI= X-Received: by 2002:a05:6808:300f:b0:451:4c8a:25e8 with SMTP id 5614622812f47-45a6bcc8803mr4261957b6e.6.1767939059656; Thu, 08 Jan 2026 22:10:59 -0800 (PST) MIME-Version: 1.0 References: <129bcfbf-47a6-e58a-190a-62fc21a17d03@migops.com> <3046422.1637337334@sss.pgh.pa.us> <3ea14054-af0c-3f21-0ced-04c896438bdc@dunslane.net> <08e09a01-5762-3b2e-1fa7-513478ab7394@migops.com> <786b70c5-ee75-4450-84e7-936a20de63b9@gmail.com> <7aa9c67e-c423-43c4-89e8-4fbe8f5019d2@darold.net> <3002ddbd-64b5-499e-b15c-e1c1720cc356@darold.net> <94634e38-7184-42a1-b9e1-7611076e1c08@darold.net> In-Reply-To: From: Yuefei Shi Date: Fri, 9 Jan 2026 14:10:47 +0800 X-Gm-Features: AQt7F2r9Zb8Gaz1Z6BcuZ99IMisOyEVZrZsyQtCmF0xiyDD__DaHrnvcORA40go Message-ID: Subject: Re: Pasword expiration warning To: Japin Li Cc: Gilles Darold , songjinzhou , PostgreSQL Hackers , Andrew Dunstan , "Bossart, Nathan" , Tom Lane , liu xiaohui Content-Type: multipart/alternative; boundary="000000000000a2aa580647ee639a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a2aa580647ee639a Content-Type: text/plain; charset="UTF-8" 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 ...` --000000000000a2aa580647ee639a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
A few review comments for V8.

=3D=3D=3D=
1.
+		if (password_exp=
ire_warning > 0 && vuntil < PG_INT64_MAX)
+		{
+			TimestampTz result =3D (vuntil - now) / USECS_PER_SEC; /* in seconds */
+
+			if (result <=3D (TimestampTz) password_expire_warning)
+				MyClientConnectionInfo.warning_message =3D
+						psprintf("your password will expire in %d day(s)", (int) (=
result / 86400));
+		}
Please consider localization of t=
he warning message.

2. typo fix
a.=
 `Controls how many time ...` should be `Controls how much time ...`.
=
b. `Sets how many time before password expi=
re to emit ...` should be `Sets how much time before password expires to em=
it ...`


--000000000000a2aa580647ee639a--