Newline after --progress report

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Newline after --progress report
Date: 2020-08-14 07:57:10
Message-ID: 82b539e5-ae33-34b0-1aee-22b3379fd3eb@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Fix-printing-last-progress-report-line-in-client-pro.patch text/x-patch 1.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Li Japin 2020-08-14 08:02:27 Re: Terminate the idle sessions
Previous Message Simon Riggs 2020-08-14 07:55:05 Re: massive FPI_FOR_HINT load after promote