From: Tom Lane <tgl@sss.pgh.pa.us>
To: Japin Li <japinli@hotmail.com>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Aleksander Alekseev <aleksander@timescale.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Maxim Orlov <orlovmg@gmail.com>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Ilya Anfimov <ilan@tzirechnoy.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Date: Thu, 17 Mar 2022 10:41:08 -0400
Message-ID: <771048.1647528068@sss.pgh.pa.us> (raw)
In-Reply-To: <MEYP282MB1669404C314BAD7EA603143FB6129@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
References: <CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq+vfkmTF5Q@mail.gmail.com>
<85f2c6c5-f8a6-5da8-67a6-9e48f56c7f77@enterprisedb.com>
<CAPpHfduUf0UpG9LWXZHBwNhx7iZ1y_YO_u9paAjBi71fVgq3_A@mail.gmail.com>
<MEYP282MB1669404C314BAD7EA603143FB6129@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
Japin Li <japinli@hotmail.com> writes:
> Maybe, we should format it to string before for localization messages,
> like the following code snippet comes from pg_backup_tar.c.
> However, I do not think it is a good way.
> snprintf(buf1, sizeof(buf1), INT64_FORMAT, (int64) len);
> snprintf(buf2, sizeof(buf2), INT64_FORMAT, (int64) th->fileLen);
> fatal("actual file length (%s) does not match expected (%s)",
> buf1, buf2);
That used to be our standard practice before we switched to always
relying on our own snprintf.c. Now, we know that "%lld" with an
explicit cast to long long will work, so that's the preferred method
for printing 64-bit values in localizable strings. Not all of the old
code has been updated, though.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, japinli@hotmail.com, aekorotkov@gmail.com, peter.eisentraut@enterprisedb.com, aleksander@timescale.com, horikyota.ntt@gmail.com, orlovmg@gmail.com, pashkin.elfe@gmail.com, ilan@tzirechnoy.com, pgsql-hackers@lists.postgresql.org
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
In-Reply-To: <771048.1647528068@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox