mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
Properly clear the verbose output of pg_basebackup
Don't leave partial filename information on the last status or dangling characters if the previous filename was longer than the current one.
This commit is contained in:
parent
56bb7f2a02
commit
4a0014806d
@ -207,11 +207,24 @@ progress_report(int tablespacenum, char *fn)
|
|||||||
percent = 100;
|
percent = 100;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr,
|
{
|
||||||
INT64_FORMAT "/" INT64_FORMAT " kB (%i%%) %i/%i tablespaces (%-30s)\r",
|
if (!fn)
|
||||||
totaldone / 1024, totalsize,
|
|
||||||
percent,
|
/*
|
||||||
tablespacenum, tablespacecount, fn);
|
* No filename given, so clear the status line (used for last
|
||||||
|
* call)
|
||||||
|
*/
|
||||||
|
fprintf(stderr,
|
||||||
|
INT64_FORMAT "/" INT64_FORMAT " kB (100%%) %i/%i tablespaces %35s\r",
|
||||||
|
totaldone / 1024, totalsize,
|
||||||
|
tablespacenum, tablespacecount, "");
|
||||||
|
else
|
||||||
|
fprintf(stderr,
|
||||||
|
INT64_FORMAT "/" INT64_FORMAT " kB (%i%%) %i/%i tablespaces (%-30.30s)\r",
|
||||||
|
totaldone / 1024, totalsize,
|
||||||
|
percent,
|
||||||
|
tablespacenum, tablespacecount, fn);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
fprintf(stderr, INT64_FORMAT "/" INT64_FORMAT " kB (%i%%) %i/%i tablespaces\r",
|
fprintf(stderr, INT64_FORMAT "/" INT64_FORMAT " kB (%i%%) %i/%i tablespaces\r",
|
||||||
totaldone / 1024, totalsize,
|
totaldone / 1024, totalsize,
|
||||||
@ -871,7 +884,7 @@ BaseBackup()
|
|||||||
|
|
||||||
if (showprogress)
|
if (showprogress)
|
||||||
{
|
{
|
||||||
progress_report(PQntuples(res), "");
|
progress_report(PQntuples(res), NULL);
|
||||||
fprintf(stderr, "\n"); /* Need to move to next line */
|
fprintf(stderr, "\n"); /* Need to move to next line */
|
||||||
}
|
}
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user