| From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
|---|---|
| To: | Nathan Bossart <nathandbossart(at)gmail(dot)com>, Gilles Darold <gilles(at)darold(dot)net> |
| Cc: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Yuefei Shi <shiyuefei1004(at)gmail(dot)com>, songjinzhou <tsinghualucky912(at)foxmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, liu xiaohui <liuxh(dot)zj(dot)cn(at)gmail(dot)com>, Steven Niu <niushiji(at)gmail(dot)com> |
| Subject: | Re: Pasword expiration warning |
| Date: | 2026-02-04 14:44:05 |
| Message-ID: | 1f4d0b80-3fea-4f4d-8d33-a652ea23e90b@eisentraut.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zsolt Parragi | 2026-02-04 14:52:35 | Re: [PATCH] New [relation] option engine |
| Previous Message | KAZAR Ayoub | 2026-02-04 14:28:56 | Re: Speed up COPY FROM text/CSV parsing using SIMD |