On Fri, Jan 9, 2026, at 8:27 AM, Gilles Darold wrote:
>
> Here is a v11 version of the patch.
>
+ if (result <= (TimestampTz) password_expire_warning)
+ {
+ MyClientConnectionInfo.warning_message =
+ psprintf(_("your password will expire in %d day(s)"),
+ (int) (result / SECS_PER_DAY));
+ }
You should use ngettext() for plural forms. I don't think you need a string
into ClientConnectionInfo. Instead, you could store only the number of days.
+ /*
+ * Emit a warning message to the client when set, for example
+ * to warn the user that the password will expire.
+ */
+ if (MyClientConnectionInfo.warning_message)
+ ereport(WARNING, (errmsg("%s",
MyClientConnectionInfo.warning_message)));
+
... and you construct the message directly in the ereport().
--
Euler Taveira
EDB https://www.enterprisedb.com/