Re: Newline after --progress report

2020-08-17 Thread Heikki Linnakangas
On 17/08/2020 16:59, Tom Lane wrote: Heikki Linnakangas writes: Good point. Pushed a patch along those lines. Uh ... you patched v12 but not v13? Darn, I forgot it exists. Also, I'd recommend that you NOT do this: + fprintf(stderr, (!finished && isatty(fileno(stderr))) ? "\r" : "\n");

Re: Newline after --progress report

2020-08-17 Thread Tom Lane
Heikki Linnakangas writes: > Good point. Pushed a patch along those lines. Uh ... you patched v12 but not v13? Also, I'd recommend that you NOT do this: + fprintf(stderr, (!finished && isatty(fileno(stderr))) ? "\r" : "\n"); as it breaks printf format verification in many/most compilers.

Re: Newline after --progress report

2020-08-17 Thread Heikki Linnakangas
On 14/08/2020 16:51, Tom Lane wrote: Heikki Linnakangas 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

Re: Newline after --progress report

2020-08-14 Thread Tom Lane
Heikki Linnakangas writes: > While hacking on pg_rewind, this in pg_rewind's main() function caught > my eye: Good catch. > 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