pg_upgrade: Tweak translatable strings
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 23 May 2022 08:54:39 +0000 (10:54 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 23 May 2022 08:54:39 +0000 (10:54 +0200)
"\r" (for progress output) must not be inside a translatable string
(gettext gets upset).

In passing, move the minimum supported version number to a separate
argument, so that we don't have to retranslate this string every year
now.

src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/util.c

index dd3972bb6cfd5a6a73785955fc5ac7f918b2fed7..6114303b527af3eb8e4013e4032fa2d7fcc8df9b 100644 (file)
@@ -289,7 +289,8 @@ check_cluster_versions(void)
     */
 
    if (GET_MAJOR_VERSION(old_cluster.major_version) < 902)
-       pg_fatal("This utility can only upgrade from PostgreSQL version 9.2 and later.\n");
+       pg_fatal("This utility can only upgrade from PostgreSQL version %s and later.\n",
+                "9.2");
 
    /* Only current PG version is supported as a target */
    if (GET_MAJOR_VERSION(new_cluster.major_version) != GET_MAJOR_VERSION(PG_VERSION_NUM))
index 9edfe7c3605502231b990372055c0bd0d2bcd90c..1a328b427003b3779606a577a48e27ecd3aa38b2 100644 (file)
@@ -47,7 +47,10 @@ end_progress_output(void)
     * nicely.
     */
    if (log_opts.isatty)
-       pg_log(PG_REPORT, "\r%-*s", MESSAGE_WIDTH, "");
+   {
+       printf("\r");
+       pg_log(PG_REPORT, "%-*s", MESSAGE_WIDTH, "");
+   }
    else if (log_opts.verbose)
        pg_log(PG_REPORT, "%-*s", MESSAGE_WIDTH, "");
 }