mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
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 <ashutosh.bapat@enterprisedb.com> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/CAExHW5ub5NaTELZ3hJUCE6amuvqAtsSxc7O+uK7y4t9Rrk23cw@mail.gmail.com
This commit is contained in:
@@ -997,8 +997,7 @@ logical_rewrite_log_mapping(RewriteState state, TransactionId xid,
|
||||
snprintf(path, MAXPGPATH,
|
||||
"pg_logical/mappings/" LOGICAL_REWRITE_FORMAT,
|
||||
dboid, relid,
|
||||
(uint32) (state->rs_begin_lsn >> 32),
|
||||
(uint32) state->rs_begin_lsn,
|
||||
LSN_FORMAT_ARGS(state->rs_begin_lsn),
|
||||
xid, GetCurrentTransactionId());
|
||||
|
||||
dlist_init(&src->mappings);
|
||||
@@ -1120,8 +1119,7 @@ heap_xlog_logical_rewrite(XLogReaderState *r)
|
||||
snprintf(path, MAXPGPATH,
|
||||
"pg_logical/mappings/" LOGICAL_REWRITE_FORMAT,
|
||||
xlrec->mapped_db, xlrec->mapped_rel,
|
||||
(uint32) (xlrec->start_lsn >> 32),
|
||||
(uint32) xlrec->start_lsn,
|
||||
LSN_FORMAT_ARGS(xlrec->start_lsn),
|
||||
xlrec->mapped_xid, XLogRecGetXid(r));
|
||||
|
||||
fd = OpenTransientFile(path,
|
||||
|
Reference in New Issue
Block a user