diff options
| author | Peter Eisentraut | 2021-02-23 09:14:38 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2021-02-23 09:27:02 +0000 |
| commit | 6f6f284c7ee44264eb3e128e2bf54d9276711d11 (patch) | |
| tree | c861d32584f751b28a065b98c03e1dd1370daa10 /src/bin/pg_basebackup/pg_recvlogical.c | |
| parent | ade89ba5f408e6034db7cc8a2c9b7858f5a214c4 (diff) | |
Simplify printing of LSNs
Add a macro LSN_FORMAT_ARGS for use in printf-style printing of LSNs.
Convert all applicable code to use it.
Reviewed-by: Ashutosh Bapat <[email protected]>
Reviewed-by: Kyotaro Horiguchi <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/CAExHW5ub5NaTELZ3hJUCE6amuvqAtsSxc7O+uK7y4t9Rrk23cw@mail.gmail.com
Diffstat (limited to 'src/bin/pg_basebackup/pg_recvlogical.c')
| -rw-r--r-- | src/bin/pg_basebackup/pg_recvlogical.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c index 553ba7b8f4d..bf0246c4266 100644 --- a/src/bin/pg_basebackup/pg_recvlogical.c +++ b/src/bin/pg_basebackup/pg_recvlogical.c @@ -131,8 +131,8 @@ sendFeedback(PGconn *conn, TimestampTz now, bool force, bool replyRequested) if (verbose) pg_log_info("confirming write up to %X/%X, flush to %X/%X (slot %s)", - (uint32) (output_written_lsn >> 32), (uint32) output_written_lsn, - (uint32) (output_fsync_lsn >> 32), (uint32) output_fsync_lsn, + LSN_FORMAT_ARGS(output_written_lsn), + LSN_FORMAT_ARGS(output_fsync_lsn), replication_slot); replybuf[len] = 'r'; @@ -228,12 +228,12 @@ StreamLogicalLog(void) */ if (verbose) pg_log_info("starting log streaming at %X/%X (slot %s)", - (uint32) (startpos >> 32), (uint32) startpos, + LSN_FORMAT_ARGS(startpos), replication_slot); /* Initiate the replication stream at specified location */ appendPQExpBuffer(query, "START_REPLICATION SLOT \"%s\" LOGICAL %X/%X", - replication_slot, (uint32) (startpos >> 32), (uint32) startpos); + replication_slot, LSN_FORMAT_ARGS(startpos)); /* print options if there are any */ if (noptions) @@ -1045,10 +1045,9 @@ prepareToTerminate(PGconn *conn, XLogRecPtr endpos, bool keepalive, XLogRecPtr l { if (keepalive) pg_log_info("end position %X/%X reached by keepalive", - (uint32) (endpos >> 32), (uint32) endpos); + LSN_FORMAT_ARGS(endpos)); else pg_log_info("end position %X/%X reached by WAL record at %X/%X", - (uint32) (endpos >> 32), (uint32) (endpos), - (uint32) (lsn >> 32), (uint32) lsn); + LSN_FORMAT_ARGS(endpos), LSN_FORMAT_ARGS(lsn)); } } |
