While hacking on pg_rewind, this in pg_rewind's main() function caught
my eye:
progress_report(true);
printf("\n");
It is peculiar, because progress_report() uses fprintf(stderr, ...) for
all its printing, and in fact the only other use of printf() in
pg_rewind is in printing the "pg_rewind --help" text.
I think the idea here was to move to the next line, after
progress_report() has updated the progress line for the last time. It
probably also should not be printed, when "--progress" is not used.
Attached is a patch to fix this, as well as a similar issue in
pg_checksums. pg_basebackup and pgbench also print progres reports like
this, but they seem correct to me.
- Heikki