pg_waldump: Fix --bkp-details to not issue spurious newlines for FPWs.
authorAndres Freund
Wed, 30 Oct 2019 05:46:40 +0000 (22:46 -0700)
committerAndres Freund
Wed, 30 Oct 2019 05:53:30 +0000 (22:53 -0700)
The additional newline seems to have accidentally been introduced in
2c03216d831, in 9.5. The newline is only issued when an FPW is
present for the block reference.

While there could be an argument that removing the newlines in the
back branches could cause a problem for somebody parsing the
pg_waldump output, the likelihood of that seems small enough. It seems
at least equally likely that the randomness of when newlines are
issued causes problems.

Author: Andres Freund
Discussion: https://postgr.es/m/20191029233341[email protected]
Backpatch: 9.5, like 2c03216d831.

src/bin/pg_waldump/pg_waldump.c

index 28839d76e1594f72e5cb0231c1ecff6a0402e73c..41dc6fc864a189afe0173c30b293d213d9baf76d 100644 (file)
@@ -600,7 +600,7 @@ XLogDumpDisplayRecord(XLogDumpConfig *config, XLogReaderState *record)
                    BKPIMAGE_IS_COMPRESSED)
                {
                    printf(" (FPW%s); hole: offset: %u, length: %u, "
-                          "compression saved: %u\n",
+                          "compression saved: %u",
                           XLogRecBlockImageApply(record, block_id) ?
                           "" : " for WAL verification",
                           record->blocks[block_id].hole_offset,
@@ -611,7 +611,7 @@ XLogDumpDisplayRecord(XLogDumpConfig *config, XLogReaderState *record)
                }
                else
                {
-                   printf(" (FPW%s); hole: offset: %u, length: %u\n",
+                   printf(" (FPW%s); hole: offset: %u, length: %u",
                           XLogRecBlockImageApply(record, block_id) ?
                           "" : " for WAL verification",
                           record->blocks[block_id].hole_offset,