Subject: [PATCH 1/1] work-in-progress: fix pg_upgrade output

From: Nathan Bossart <[email-masked]>
Date: Wed, 2 Aug 2023 10:20:11 -0700

---
 src/bin/pg_upgrade/util.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/bin/pg_upgrade/util.c b/src/bin/pg_upgrade/util.c
index 21ba4c8f12..bea6d7289d 100644
--- a/src/bin/pg_upgrade/util.c
+++ b/src/bin/pg_upgrade/util.c
@@ -50,10 +50,10 @@ end_progress_output(void)
 	if (log_opts.isatty)
 	{
 		printf("\r");
-		pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, "");
+		pg_log(PG_REPORT_NONL, "%-*s\r  ", MESSAGE_WIDTH, "");
 	}
 	else if (log_opts.verbose)
-		pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, "");
+		pg_log(PG_REPORT_NONL, "  ");
 }
 
 /*
@@ -114,9 +114,6 @@ cleanup_output_dirs(void)
  * prep_status
  *
  *	Displays a message that describes an operation we are about to begin.
- *	We pad the message out to MESSAGE_WIDTH characters so that all of the
- *	"ok" and "failed" indicators line up nicely.  (Overlength messages
- *	will be truncated, so don't get too verbose.)
  *
  *	A typical sequence would look like this:
  *		prep_status("about to flarb the next %d files", fileCount);
@@ -135,8 +132,7 @@ prep_status(const char *fmt,...)
 	vsnprintf(message, sizeof(message), fmt, args);
 	va_end(args);
 
-	/* trim strings */
-	pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, message);
+	pg_log(PG_REPORT_NONL, "%s ... ", message);
 }
 
 /*
@@ -167,9 +163,9 @@ prep_status_progress(const char *fmt,...)
 	 * put the individual progress items onto the next line.
 	 */
 	if (log_opts.isatty || log_opts.verbose)
-		pg_log(PG_REPORT, "%-*s", MESSAGE_WIDTH, message);
+		pg_log(PG_REPORT, "%s ...", message);
 	else
-		pg_log(PG_REPORT_NONL, "%-*s", MESSAGE_WIDTH, message);
+		pg_log(PG_REPORT_NONL, "%s ... ", message);
 }
 
 static void
-- 
2.25.1

--gBBFr7Ir9EOA20Yy--