postgres.git / summary / log / commit / refs
commit 3f8913f683ba99e7135d374541f52c626fcc6eec
Author: Andrew Dunstan <andrew@dunslane.net>
Date: Fri Apr 10 13:29:00 2026 +0000
First released in: 19.0
Use size_t instead of Size in pg_waldump
In commit b15c1513984 I missed the memo about not using Size in new
code.
Per complaint from Thomas Munro
Discussion: https://postgr.es/m/CA+hUKGJkeTVuq5u5WKJm6xkwmW577UuQ7fA=PyBCSR3h9g2GtQ@mail.gmail.com
src/bin/pg_waldump/archive_waldump.c | 14 ++++++--------
src/bin/pg_waldump/pg_waldump.h | 4 ++--
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/bin/pg_waldump/archive_waldump.c b/src/bin/pg_waldump/archive_waldump.c
index e4a4bf44a7e..78b03bc1f85 100644
--- a/src/bin/pg_waldump/archive_waldump.c
+++ b/src/bin/pg_waldump/archive_waldump.c
@@ -299,10 +299,10 @@ free_archive_reader(XLogDumpPrivate *privateInfo)
*/
int
read_archive_wal_page(XLogDumpPrivate *privateInfo, XLogRecPtr targetPagePtr,
- Size count, char *readBuff)
+ size_t count, char *readBuff)
{
char *p = readBuff;
- Size nbytes = count;
+ size_t nbytes = count;
XLogRecPtr recptr = targetPagePtr;
int segsize = privateInfo->segsize;
XLogSegNo segno;
@@ -364,15 +364,13 @@ read_archive_wal_page(XLogDumpPrivate *privateInfo, XLogRecPtr targetPagePtr,
* archive reached EOF.
*/
if (privateInfo->cur_file != entry)
- pg_fatal("WAL segment \"%s\" in archive \"%s\" is too short: read %lld of %lld bytes",
+ pg_fatal("WAL segment \"%s\" in archive \"%s\" is too short: read %zu of %zu bytes",
fname, privateInfo->archive_name,
- (long long int) (count - nbytes),
- (long long int) count);
+ (count - nbytes), count);
if (!read_archive_file(privateInfo))
- pg_fatal("unexpected end of archive \"%s\" while reading \"%s\": read %lld of %lld bytes",
+ pg_fatal("unexpected end of archive \"%s\" while reading \"%s\": read %zu of %zu bytes",
privateInfo->archive_name, fname,
- (long long int) (count - nbytes),
- (long long int) count);
+ (count - nbytes), count);
/*
* Loading more data may have moved hash table entries, so we must
diff --git a/src/bin/pg_waldump/pg_waldump.h b/src/bin/pg_waldump/pg_waldump.h
index bd46d14f3a8..beb61ec5892 100644
--- a/src/bin/pg_waldump/pg_waldump.h
+++ b/src/bin/pg_waldump/pg_waldump.h
@@ -39,7 +39,7 @@ typedef struct XLogDumpPrivate
astreamer *archive_streamer;
char *archive_read_buf; /* Reusable read buffer for archive I/O */
- Size archive_read_buf_size;
+ size_t archive_read_buf_size;
/*
* The buffer for the WAL file the archive streamer is currently reading,
@@ -75,7 +75,7 @@ extern void init_archive_reader(XLogDumpPrivate *privateInfo,
extern void free_archive_reader(XLogDumpPrivate *privateInfo);
extern int read_archive_wal_page(XLogDumpPrivate *privateInfo,
XLogRecPtr targetPagePtr,
- Size count, char *readBuff);
+ size_t count, char *readBuff);
extern void free_archive_wal_entry(const char *fname,
XLogDumpPrivate *privateInfo);
[parent: 4a18907b412e]