From: Heikki Linnakangas Date: Tue, 30 Jul 2019 18:14:14 +0000 (+0300) Subject: Print WAL position correctly in pg_rewind error message. X-Git-Tag: REL_11_5~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6380f8a4b424cf097a066b45b91fa43d367c562;p=postgresql Print WAL position correctly in pg_rewind error message. This has been wrong ever since pg_rewind was added. The if-branch just above this, where we print the same error with an extra message supplied by XLogReadRecord() got this right, but the variable name was wrong in the else-branch. As a consequence, the error printed the WAL position as 0/0 if there was an error reading a WAL file. Backpatch to 9.5, where pg_rewind was added. --- diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c index 1689279767..8641dce306 100644 --- a/src/bin/pg_rewind/parsexlog.c +++ b/src/bin/pg_rewind/parsexlog.c @@ -90,8 +90,7 @@ extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex, errormsg); else pg_fatal("could not read WAL record at %X/%X\n", - (uint32) (startpoint >> 32), - (uint32) (startpoint)); + (uint32) (errptr >> 32), (uint32) (errptr)); } extractPageInfo(xlogreader);