Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Date
Msg-id 771048.1647528068@sss.pgh.pa.us
Whole thread Raw
In response to Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Japin Li <japinli@hotmail.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Column Filtering in Logical Replication
Next
From: Pavel Borisov
Date:
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)