postgresql/src/bin/pg_waldump
Heikki Linnakangas 38a957316d Refactor XLogReadRecord(), adding XLogBeginRead() function.
The signature of XLogReadRecord() required the caller to pass the starting
WAL position as argument, or InvalidXLogRecPtr to continue reading at the
end of previous record. That's slightly awkward to the callers, as most
of them don't want to randomly jump around in the WAL stream, but start
reading at one position and then read everything from that point onwards.
Remove the 'RecPtr' argument and add a new function XLogBeginRead() to
specify the starting position instead. That's more convenient for the
callers. Also, xlogreader holds state that is reset when you change the
starting position, so having a separate function for doing that feels like
a more natural fit.

This changes XLogFindNextRecord() function so that it doesn't reset the
xlogreader's state to what it was before the call anymore. Instead, it
positions the xlogreader to the found record, like XLogBeginRead().

Reviewed-by: Kyotaro Horiguchi, Alvaro Herrera
Discussion: https://www.postgresql.org/message-id/5382a7a3-debe-be31-c860-cb810c08f366%40iki.fi
2020-01-26 11:39:00 +02:00
..
po Translation updates 2019-06-17 15:30:20 +02:00
t pg_waldump: Fix invalid option handling 2019-06-06 10:14:25 +02:00
.gitignore Avoid use of wildcard in pg_waldump's .gitignore. 2019-10-05 12:26:55 -04:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
compat.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
pg_waldump.c Refactor XLogReadRecord(), adding XLogBeginRead() function. 2020-01-26 11:39:00 +02:00
rmgrdesc.c Split index xlog headers from other private index headers. 2017-02-14 15:37:59 -05:00
rmgrdesc.h Fix assorted header files that failed to compile standalone. 2019-05-31 11:45:33 -04:00