]> granicus.if.org Git - postgresql/commitdiff
pg_upgrade i18n: Fix "%s server/cluster" wording
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 14 Jul 2017 23:20:21 +0000 (19:20 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 14 Jul 2017 23:21:34 +0000 (19:21 -0400)
The original wording was impossible to translate correctly.

Discussion: https://postgr.es/m/20170523002827.lzc2jkzh2gubclqb@alvherre.pgsql

src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/controldata.c
src/bin/pg_upgrade/info.c
src/bin/pg_upgrade/option.c
src/bin/pg_upgrade/pg_upgrade.h
src/bin/pg_upgrade/server.c

index 120c9ae2652e185bfa81794f6435f08a49f96b89..3d0fb96187fa4f5e4352e3edcdd88ce61fc6b81e 100644 (file)
@@ -770,8 +770,12 @@ check_for_prepared_transactions(ClusterInfo *cluster)
                                                        "FROM pg_catalog.pg_prepared_xacts");
 
        if (PQntuples(res) != 0)
-               pg_fatal("The %s cluster contains prepared transactions\n",
-                                CLUSTER_NAME(cluster));
+       {
+               if (cluster == &old_cluster)
+                       pg_fatal("The source cluster contains prepared transactions\n");
+               else
+                       pg_fatal("The target cluster contains prepared transactions\n");
+       }
 
        PQclear(res);
 
@@ -1082,8 +1086,12 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
                                                        "WHERE rolname ~ '^pg_'");
 
        if (PQntuples(res) != 0)
-               pg_fatal("The %s cluster contains roles starting with 'pg_'\n",
-                                CLUSTER_NAME(cluster));
+       {
+               if (cluster == &old_cluster)
+                       pg_fatal("The source cluster contains roles starting with 'pg_'\n");
+               else
+                       pg_fatal("The target cluster contains roles starting with 'pg_'\n");
+       }
 
        PQclear(res);
 
index 3abef16c815a53f83c509407d2258cbfb3fa6c37..ca3db1a2f692e59eb4181aa43bf0354c4594303a 100644 (file)
@@ -474,9 +474,12 @@ get_control_data(ClusterInfo *cluster, bool live_check)
                 cluster->controldata.ctrl_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER) ||
                !got_date_is_int || !got_data_checksum_version)
        {
-               pg_log(PG_REPORT,
-                          "The %s cluster lacks some required control information:\n",
-                          CLUSTER_NAME(cluster));
+               if (cluster == &old_cluster)
+                       pg_log(PG_REPORT,
+                                  "The source cluster lacks some required control information:\n");
+               else
+                       pg_log(PG_REPORT,
+                                  "The target cluster lacks some required control information:\n");
 
                if (!got_xid)
                        pg_log(PG_REPORT, "  checkpoint next XID\n");
index 6500302c3d441188a7694b86420c684c0d03baaa..f7c278b30694a45bb2ffbb4dcbdfa641245c1deb 100644 (file)
@@ -320,7 +320,11 @@ get_db_and_rel_infos(ClusterInfo *cluster)
        for (dbnum = 0; dbnum < cluster->dbarr.ndbs; dbnum++)
                get_rel_infos(cluster, &cluster->dbarr.dbs[dbnum]);
 
-       pg_log(PG_VERBOSE, "\n%s databases:\n", CLUSTER_NAME(cluster));
+       if (cluster == &old_cluster)
+               pg_log(PG_VERBOSE, "\nsource databases:\n");
+       else
+               pg_log(PG_VERBOSE, "\ntarget databases:\n");
+
        if (log_opts.verbose)
                print_db_infos(&cluster->dbarr);
 }
index cb77665cdab3b97218aa57891e2c8dc31d71b79b..bbe364741cebfb4953a912db7c5b7d57b3a452ce 100644 (file)
@@ -405,8 +405,10 @@ adjust_data_dir(ClusterInfo *cluster)
 
        /* Must be a configuration directory, so find the real data directory. */
 
-       prep_status("Finding the real data directory for the %s cluster",
-                               CLUSTER_NAME(cluster));
+       if (cluster == &old_cluster)
+               prep_status("Finding the real data directory for the source cluster");
+       else
+               prep_status("Finding the real data directory for the target cluster");
 
        /*
         * We don't have a data directory yet, so we can't check the PG version,
index 13f7ebfe5a2bebd9247741071e6c649247b6488d..dae068ed83f72a15d66270d95047bf7aae387035 100644 (file)
@@ -94,8 +94,6 @@ extern char *output_files[];
 #define ECHO_BLANK     "."
 #endif
 
-#define CLUSTER_NAME(cluster)  ((cluster) == &old_cluster ? "old" : \
-                                                                (cluster) == &new_cluster ? "new" : "none")
 
 /* OID system catalog preservation added during PG 9.0 development */
 #define TABLE_SPACE_SUBDIRS_CAT_VER 201001111
index 23ba6a2e11b8e1495f9b79b2b7c94d4063fd4300..58e35938967523ec23bbdf85e14ea8092a30cf11 100644 (file)
@@ -285,9 +285,14 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
                           PQerrorMessage(conn));
                if (conn)
                        PQfinish(conn);
-               pg_fatal("could not connect to %s postmaster started with the command:\n"
-                                "%s\n",
-                                CLUSTER_NAME(cluster), cmd);
+               if (cluster == &old_cluster)
+                       pg_fatal("could not connect to source postmaster started with the command:\n"
+                                        "%s\n",
+                                        cmd);
+               else
+                       pg_fatal("could not connect to target postmaster started with the command:\n"
+                                        "%s\n",
+                                        cmd);
        }
        PQfinish(conn);
 
@@ -297,8 +302,12 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
         * running.
         */
        if (!pg_ctl_return)
-               pg_fatal("pg_ctl failed to start the %s server, or connection failed\n",
-                                CLUSTER_NAME(cluster));
+       {
+               if (cluster == &old_cluster)
+                       pg_fatal("pg_ctl failed to start the source server, or connection failed\n");
+               else
+                       pg_fatal("pg_ctl failed to start the target server, or connection failed\n");
+       }
 
        return true;
 }