Re: Pasword expiration warning - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Pasword expiration warning
Date
Msg-id 1f4d0b80-3fea-4f4d-8d33-a652ea23e90b@eisentraut.org
Whole thread Raw
In response to Re: Pasword expiration warning  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Pasword expiration warning
List pgsql-hackers
On 03.02.26 16:28, Nathan Bossart wrote:
> +            detail = psprintf(_("The password for role \"%s\" will expire in "
> +                                INT64_FORMAT " day(s), " INT64_FORMAT
> +                                " hour(s), " INT64_FORMAT " minute(s)."),
> +                              role, days, hours, minutes);

You cannot use INT64_FORMAT inside translatable messages.  But you can 
use PRId64.

Using the type TimestampTz for what are essentially interval/duration 
quantities is a bit weird and confusing.  So maybe another placeholder 
would be more appropriate.

That said, I find writing plurals with "(s)" kind of lame.  It's not a 
good look.

It's a bit difficult to do this correctly when you have three separate 
values in one string.  I would consider for example just showing the 
number of days if the value is larger than one day, number hours if it's 
larger than one hour, else minutes.  I don't think you need 
minute-precision when the expiration time is several days out. 
Alternatively, just print the actual expiration timestamp.





pgsql-hackers by date:

Previous
From: KAZAR Ayoub
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Next
From: Zsolt Parragi
Date:
Subject: Re: [PATCH] New [relation] option engine