pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix printing last progress report line in client programs.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix printing last progress report line in client programs.
@ 2020-08-17 07:14  Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 3+ messages in thread

From: Heikki Linnakangas @ 2020-08-17 07:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix printing last progress report line in client programs.

A number of client programs have a "--progress" option that when printing
to a TTY, updates the current line by printing a '\r' and overwriting it.
After the last line, '\n' needs to be printed to move the cursor to the
next line. pg_basebackup and pgbench got this right, but pg_rewind and
pg_checksums were slightly wrong. pg_rewind printed the newline to stdout
instead of stderr, and pg_checksums printed the newline even when not
printing to a TTY. Fix them, and also add a 'finished' argument to
pg_basebackup's progress_report() function, to keep it consistent with
the other programs.

Backpatch to v12. pg_rewind's newline was broken with the logging changes
in commit cc8d415117 in v12, and pg_checksums was introduced in v12.

Discussion: https://www.postgresql.org/message-id/82b539e5-ae33-34b0-1aee-22b3379fd3eb@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d7ec8337f9093b097f08f94e5ecec36303ad73fd

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 38 ++++++++++++++++++-----------------
src/bin/pg_checksums/pg_checksums.c   | 14 ++++++-------
src/bin/pg_rewind/pg_rewind.c         | 22 +++++++++++---------
src/bin/pg_rewind/pg_rewind.h         |  2 +-
4 files changed, 41 insertions(+), 35 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix printing last progress report line in client programs.
@ 2020-08-17 07:14  Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 3+ messages in thread

From: Heikki Linnakangas @ 2020-08-17 07:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix printing last progress report line in client programs.

A number of client programs have a "--progress" option that when printing
to a TTY, updates the current line by printing a '\r' and overwriting it.
After the last line, '\n' needs to be printed to move the cursor to the
next line. pg_basebackup and pgbench got this right, but pg_rewind and
pg_checksums were slightly wrong. pg_rewind printed the newline to stdout
instead of stderr, and pg_checksums printed the newline even when not
printing to a TTY. Fix them, and also add a 'finished' argument to
pg_basebackup's progress_report() function, to keep it consistent with
the other programs.

Backpatch to v12. pg_rewind's newline was broken with the logging changes
in commit cc8d415117 in v12, and pg_checksums was introduced in v12.

Discussion: https://www.postgresql.org/message-id/82b539e5-ae33-34b0-1aee-22b3379fd3eb@iki.fi

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9f44d71b06b0d457ad3e5d7fdcbba2039f3000ef

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 38 ++++++++++++++++++-----------------
src/bin/pg_checksums/pg_checksums.c   | 14 ++++++-------
src/bin/pg_rewind/pg_rewind.c         | 22 +++++++++++---------
src/bin/pg_rewind/pg_rewind.h         |  2 +-
4 files changed, 41 insertions(+), 35 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix printing last progress report line in client programs.
@ 2020-08-17 14:19  Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 3+ messages in thread

From: Heikki Linnakangas @ 2020-08-17 14:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix printing last progress report line in client programs.

A number of client programs have a "--progress" option that when printing
to a TTY, updates the current line by printing a '\r' and overwriting it.
After the last line, '\n' needs to be printed to move the cursor to the
next line. pg_basebackup and pgbench got this right, but pg_rewind and
pg_checksums were slightly wrong. pg_rewind printed the newline to stdout
instead of stderr, and pg_checksums printed the newline even when not
printing to a TTY. Fix them, and also add a 'finished' argument to
pg_basebackup's progress_report() function, to keep it consistent with
the other programs.

Backpatch to v12. pg_rewind's newline was broken with the logging changes
in commit cc8d415117 in v12, and pg_checksums was introduced in v12.

Discussion: https://www.postgresql.org/message-id/82b539e5-ae33-34b0-1aee-22b3379fd3eb@iki.fi

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5ca1798f32b7fe730fef7ccd8d69e785a50134b8

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 38 ++++++++++++++++++-----------------
src/bin/pg_checksums/pg_checksums.c   | 14 ++++++-------
src/bin/pg_rewind/pg_rewind.c         | 22 +++++++++++---------
src/bin/pg_rewind/pg_rewind.h         |  2 +-
4 files changed, 41 insertions(+), 35 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-08-17 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 07:14 pgsql: Fix printing last progress report line in client programs. Heikki Linnakangas <heikki.linnakangas@iki.fi>
2020-08-17 07:14 pgsql: Fix printing last progress report line in client programs. Heikki Linnakangas <heikki.linnakangas@iki.fi>
2020-08-17 14:19 pgsql: Fix printing last progress report line in client programs. Heikki Linnakangas <heikki.linnakangas@iki.fi>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox