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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Дата
Msg-id 771048.1647528068@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Japin Li <japinli@hotmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Column Filtering in Logical Replication
Следующее
От: Pavel Borisov
Дата:
Сообщение: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)