Newline after --progress report - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Newline after --progress report
Date
Msg-id 82b539e5-ae33-34b0-1aee-22b3379fd3eb@iki.fi
Whole thread Raw
Responses Re: Newline after --progress report
List 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

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: massive FPI_FOR_HINT load after promote
Next
From: Li Japin
Date:
Subject: Re: Terminate the idle sessions