Re: Pasword expiration warning - Mailing list pgsql-hackers

From Japin Li
Subject Re: Pasword expiration warning
Date
Msg-id MEAPR01MB30319B858B3028CA38BEDC5EB682A@MEAPR01MB3031.ausprd01.prod.outlook.com
Whole thread Raw
In response to Pasword expiration warning  (Gilles Darold <gilles@migops.com>)
Responses Re: Pasword expiration warning
List pgsql-hackers
On Fri, 09 Jan 2026 at 14:10, Yuefei Shi <shiyuefei1004@gmail.com> wrote:
> 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...`
 


Nice catch. Updated in v9.  Please take to look.

I've also replaced the magic constant 86400 with the SECS_PER_DAY macro and
enclosed the statement in braces since it now spans multiple lines.

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.


Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication
Next
From: Steven Niu
Date:
Subject: Re: Pasword expiration warning