mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Unwind some workarounds for lack of portable int64 format specifier
Because there is no portable int64/uint64 format specifier and we can't stick macros like INT64_FORMAT into the middle of a translatable string, we have been using various workarounds that put the number to be printed into a string buffer first. Now that we always use our own sprintf(), we can rely on %lld and %llu to work, so we can use those. This patch undoes this workaround in a few places where it was egregiously verbose. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/CAH2-Wz%3DWbNxc5ob5NJ9yqo2RMJ0q4HXDS30GVCobeCvC9A1L9A%40mail.gmail.com
This commit is contained in:
@ -783,20 +783,10 @@ XLogReaderValidatePageHeader(XLogReaderState *state, XLogRecPtr recptr,
|
||||
if (state->system_identifier &&
|
||||
longhdr->xlp_sysid != state->system_identifier)
|
||||
{
|
||||
char fhdrident_str[32];
|
||||
char sysident_str[32];
|
||||
|
||||
/*
|
||||
* Format sysids separately to keep platform-dependent format code
|
||||
* out of the translatable message string.
|
||||
*/
|
||||
snprintf(fhdrident_str, sizeof(fhdrident_str), UINT64_FORMAT,
|
||||
longhdr->xlp_sysid);
|
||||
snprintf(sysident_str, sizeof(sysident_str), UINT64_FORMAT,
|
||||
state->system_identifier);
|
||||
report_invalid_record(state,
|
||||
"WAL file is from different database system: WAL file database system identifier is %s, pg_control database system identifier is %s",
|
||||
fhdrident_str, sysident_str);
|
||||
"WAL file is from different database system: WAL file database system identifier is %llu, pg_control database system identifier is %llu",
|
||||
(unsigned long long) longhdr->xlp_sysid,
|
||||
(unsigned long long) state->system_identifier);
|
||||
return false;
|
||||
}
|
||||
else if (longhdr->xlp_seg_size != state->wal_segment_size)
|
||||
|
Reference in New Issue
Block a user