Re: Newline after --progress report

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-08-17T07:14:38Z
Lists: pgsql-hackers
On 14/08/2020 16:51, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>> 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.
> 
> I wonder whether it'd be better to push the responsibility for this
> into progress_report(), by adding an additional parameter "bool last"
> or the like.  Then the callers would not need such an unseemly amount
> of knowledge about what progress_report() is doing.

Good point. Pushed a patch along those lines.

- Heikki



Commits

  1. Avoid non-constant format string argument to fprintf().

  2. Fix printing last progress report line in client programs.