Alvaro Herrera wrote:
> Translatability was turned on for pg_upgrade on pg10, but it needs some
> work.  The choices are we fix it now, or we revert the addition of NLS
> there and we do it for PG11.

Here are two patches to fix the messages, replacing "new" with "target"
and "old" with "source".  I was going to do just the first one
initially, but I figured that the output would become wildly
inconsistent if I stopped at that point.

Now we still have one inconsistency left: the command-line options
--old-bindir --new-datadir etc all contain the words "new" and "old".
Same with a bunch of environment variables.  I think the real solution
is that we should change those to --source-bindir and --target-datadir
respectively (and the other ones continue to work for backwards
compatibility), but then maybe leave them alone.

I'll continue fixing things.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>From 87b904eeaf82dbd402d5f764de8cd2b209cd17ba Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvhe...@alvh.no-ip.org>
Date: Sat, 27 May 2017 22:24:24 -0400
Subject: [PATCH 1/2] pg_upgrade: Fix "%s server/cluster" wording

---
 src/bin/pg_upgrade/check.c       | 16 ++++++++++++----
 src/bin/pg_upgrade/controldata.c |  9 ++++++---
 src/bin/pg_upgrade/info.c        |  6 +++++-
 src/bin/pg_upgrade/option.c      |  6 ++++--
 src/bin/pg_upgrade/pg_upgrade.h  |  2 --
 src/bin/pg_upgrade/server.c      | 19 ++++++++++++++-----
 6 files changed, 41 insertions(+), 17 deletions(-)

diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index 8b9e81eb40..9df4270b3c 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -768,8 +768,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);
 
@@ -1080,8 +1084,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);
 
diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c
index 519256851c..abebb15a94 100644
--- a/src/bin/pg_upgrade/controldata.c
+++ b/src/bin/pg_upgrade/controldata.c
@@ -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");
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index ab6328eef5..669524c74a 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -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);
 }
diff --git a/src/bin/pg_upgrade/option.c b/src/bin/pg_upgrade/option.c
index 5a556e7b30..1406c5b46f 100644
--- a/src/bin/pg_upgrade/option.c
+++ b/src/bin/pg_upgrade/option.c
@@ -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,
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index 8fbf8acd7e..d8a95387c4 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -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
diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c
index 87a98983e2..a6458b5707 100644
--- a/src/bin/pg_upgrade/server.c
+++ b/src/bin/pg_upgrade/server.c
@@ -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;
 }
-- 
2.11.0

>From aeec1a4397da41f6c74facadd3b15a4bc6c51820 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvhe...@alvh.no-ip.org>
Date: Sat, 27 May 2017 22:47:57 -0400
Subject: [PATCH 2/2] pg_upgrade: in translatable messages, s/new/target/ and
 s/old/source/

---
 src/bin/pg_upgrade/check.c       | 34 ++++++++++++++--------------
 src/bin/pg_upgrade/controldata.c | 34 ++++++++++++++--------------
 src/bin/pg_upgrade/function.c    | 10 ++++-----
 src/bin/pg_upgrade/info.c        |  6 ++---
 src/bin/pg_upgrade/option.c      | 48 ++++++++++++++++++++--------------------
 src/bin/pg_upgrade/pg_upgrade.c  | 28 +++++++++++------------
 src/bin/pg_upgrade/relfilenode.c |  2 +-
 src/bin/pg_upgrade/version.c     | 12 +++++-----
 8 files changed, 87 insertions(+), 87 deletions(-)

diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index 9df4270b3c..6837a9c1a1 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -169,7 +169,7 @@ report_clusters_compatible(void)
 
        pg_log(PG_REPORT, "\n"
                   "If pg_upgrade fails after this point, you must re-initdb 
the\n"
-                  "new cluster before continuing.\n");
+                  "target cluster before continuing.\n");
 }
 
 
@@ -202,25 +202,25 @@ output_completion_banner(char *analyze_script_file_name,
        if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
                pg_log(PG_REPORT,
                           "Optimizer statistics are not transferred by 
pg_upgrade so,\n"
-                          "once you start the new server, consider running:\n"
+                          "once you start the target server, consider 
running:\n"
                           "    %s\n\n", analyze_script_file_name);
        else
                pg_log(PG_REPORT,
                           "Optimizer statistics and free space information are 
not transferred\n"
-               "by pg_upgrade so, once you start the new server, consider 
running:\n"
+               "by pg_upgrade so, once you start the target server, consider 
running:\n"
                           "    %s\n\n", analyze_script_file_name);
 
 
        if (deletion_script_file_name)
                pg_log(PG_REPORT,
-                       "Running this script will delete the old cluster's data 
files:\n"
+                       "Running this script will delete the source cluster's 
data files:\n"
                           "    %s\n",
                           deletion_script_file_name);
        else
                pg_log(PG_REPORT,
-                "Could not create a script to delete the old cluster's data 
files\n"
-                          "because user-defined tablespaces or the new 
cluster's data directory\n"
-                          "exist in the old cluster directory.  The old 
cluster's contents must\n"
+                "Could not create a script to delete the source cluster's data 
files\n"
+                          "because user-defined tablespaces or the target 
cluster's data directory\n"
+                          "exist in the source cluster directory.  The source 
cluster's contents must\n"
                           "be deleted manually.\n");
 }
 
@@ -258,10 +258,10 @@ check_cluster_versions(void)
        /* Ensure binaries match the designated data directories */
        if (GET_MAJOR_VERSION(old_cluster.major_version) !=
                GET_MAJOR_VERSION(old_cluster.bin_version))
-               pg_fatal("Old cluster data and binary directories are from 
different major versions.\n");
+               pg_fatal("Source cluster data and binary directories are from 
different major versions.\n");
        if (GET_MAJOR_VERSION(new_cluster.major_version) !=
                GET_MAJOR_VERSION(new_cluster.bin_version))
-               pg_fatal("New cluster data and binary directories are from 
different major versions.\n");
+               pg_fatal("Target cluster data and binary directories are from 
different major versions.\n");
 
        check_ok();
 }
@@ -284,8 +284,8 @@ check_cluster_compatibility(bool live_check)
        /* We read the real port number for PG >= 9.1 */
        if (live_check && GET_MAJOR_VERSION(old_cluster.major_version) < 901 &&
                old_cluster.port == DEF_PGUPORT)
-               pg_fatal("When checking a pre-PG 9.1 live old server, "
-                                "you must specify the old server's port 
number.\n");
+               pg_fatal("When checking a pre-PG 9.1 live source server, "
+                                "you must specify the source server's port 
number.\n");
 
        if (live_check && old_cluster.port == new_cluster.port)
                pg_fatal("When checking a live server, "
@@ -384,7 +384,7 @@ check_new_cluster_is_empty(void)
                {
                        /* pg_largeobject and its index should be skipped */
                        if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") 
!= 0)
-                               pg_fatal("New cluster database \"%s\" is not 
empty\n",
+                               pg_fatal("Target cluster database \"%s\" is not 
empty\n",
                                                 
new_cluster.dbarr.dbs[dbnum].db_name);
                }
        }
@@ -431,7 +431,7 @@ create_script_for_cluster_analyze(char 
**analyze_script_file_name)
        FILE       *script = NULL;
        PQExpBufferData user_specification;
 
-       prep_status("Creating script to analyze new cluster");
+       prep_status("Creating script to analyze target cluster");
 
        initPQExpBuffer(&user_specification);
        if (os_info.user_specified)
@@ -570,7 +570,7 @@ create_script_for_old_cluster_deletion(char 
**deletion_script_file_name)
                }
        }
 
-       prep_status("Creating script to delete old cluster");
+       prep_status("Creating script to delete source cluster");
 
        if ((script = fopen_priv(*deletion_script_file_name, "w")) == NULL)
                pg_fatal("could not open file \"%s\": %s\n",
@@ -684,7 +684,7 @@ check_is_install_user(ClusterInfo *cluster)
         * error during pg_dump restore.
         */
        if (cluster == &new_cluster && atooid(PQgetvalue(res, 0, 0)) != 1)
-               pg_fatal("Only the install user can be defined in the new 
cluster.\n");
+               pg_fatal("Only the install user can be defined in the target 
cluster.\n");
 
        PQclear(res);
 
@@ -861,10 +861,10 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo 
*cluster)
        {
                pg_log(PG_REPORT, "fatal\n");
                pg_fatal("Your installation contains \"contrib/isn\" functions 
which rely on the\n"
-                 "bigint data type.  Your old and new clusters pass bigint 
values\n"
+                 "bigint data type.  Your source and target clusters pass 
bigint values\n"
                "differently so this cluster cannot currently be upgraded.  You 
can\n"
                                 "manually upgrade databases that use 
\"contrib/isn\" facilities and remove\n"
-                                "\"contrib/isn\" from the old cluster and 
restart the upgrade.  A list of\n"
+                                "\"contrib/isn\" from the source cluster and 
restart the upgrade.  A list of\n"
                                 "the problem functions is in the file:\n"
                                 "    %s\n\n", output_path);
        }
diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c
index abebb15a94..3b93548d1e 100644
--- a/src/bin/pg_upgrade/controldata.c
+++ b/src/bin/pg_upgrade/controldata.c
@@ -553,37 +553,37 @@ check_control_data(ControlData *oldctrl,
                                   ControlData *newctrl)
 {
        if (oldctrl->align == 0 || oldctrl->align != newctrl->align)
-               pg_fatal("old and new pg_controldata alignments are invalid or 
do not match\n"
+               pg_fatal("source and target pg_controldata alignments are 
invalid or do not match\n"
                           "Likely one cluster is a 32-bit install, the other 
64-bit\n");
 
        if (oldctrl->blocksz == 0 || oldctrl->blocksz != newctrl->blocksz)
-               pg_fatal("old and new pg_controldata block sizes are invalid or 
do not match\n");
+               pg_fatal("source and target pg_controldata block sizes are 
invalid or do not match\n");
 
        if (oldctrl->largesz == 0 || oldctrl->largesz != newctrl->largesz)
-               pg_fatal("old and new pg_controldata maximum relation segment 
sizes are invalid or do not match\n");
+               pg_fatal("source and target pg_controldata maximum relation 
segment sizes are invalid or do not match\n");
 
        if (oldctrl->walsz == 0 || oldctrl->walsz != newctrl->walsz)
-               pg_fatal("old and new pg_controldata WAL block sizes are 
invalid or do not match\n");
+               pg_fatal("source and target pg_controldata WAL block sizes are 
invalid or do not match\n");
 
        if (oldctrl->walseg == 0 || oldctrl->walseg != newctrl->walseg)
-               pg_fatal("old and new pg_controldata WAL segment sizes are 
invalid or do not match\n");
+               pg_fatal("source and target pg_controldata WAL segment sizes 
are invalid or do not match\n");
 
        if (oldctrl->ident == 0 || oldctrl->ident != newctrl->ident)
-               pg_fatal("old and new pg_controldata maximum identifier lengths 
are invalid or do not match\n");
+               pg_fatal("source and target pg_controldata maximum identifier 
lengths are invalid or do not match\n");
 
        if (oldctrl->index == 0 || oldctrl->index != newctrl->index)
-               pg_fatal("old and new pg_controldata maximum indexed columns 
are invalid or do not match\n");
+               pg_fatal("source and target pg_controldata maximum indexed 
columns are invalid or do not match\n");
 
        if (oldctrl->toast == 0 || oldctrl->toast != newctrl->toast)
-               pg_fatal("old and new pg_controldata maximum TOAST chunk sizes 
are invalid or do not match\n");
+               pg_fatal("source and target pg_controldata maximum TOAST chunk 
sizes are invalid or do not match\n");
 
        /* large_object added in 9.5, so it might not exist in the old cluster 
*/
        if (oldctrl->large_object != 0 &&
                oldctrl->large_object != newctrl->large_object)
-               pg_fatal("old and new pg_controldata large-object chunk sizes 
are invalid or do not match\n");
+               pg_fatal("source and target pg_controldata large-object chunk 
sizes are invalid or do not match\n");
 
        if (oldctrl->date_is_int != newctrl->date_is_int)
-               pg_fatal("old and new pg_controldata date/time storage types do 
not match\n");
+               pg_fatal("source and target pg_controldata date/time storage 
types do not match\n");
 
        /*
         * float8_pass_by_value does not need to match, but is used in
@@ -596,12 +596,12 @@ check_control_data(ControlData *oldctrl,
         */
        if (oldctrl->data_checksum_version == 0 &&
                newctrl->data_checksum_version != 0)
-               pg_fatal("old cluster does not use data checksums but the new 
one does\n");
+               pg_fatal("source cluster does not use data checksums but the 
target one does\n");
        else if (oldctrl->data_checksum_version != 0 &&
                         newctrl->data_checksum_version == 0)
-               pg_fatal("old cluster uses data checksums but the new one does 
not\n");
+               pg_fatal("source cluster uses data checksums but the target one 
does not\n");
        else if (oldctrl->data_checksum_version != 
newctrl->data_checksum_version)
-               pg_fatal("old and new cluster pg_controldata checksum versions 
do not match\n");
+               pg_fatal("source and target cluster pg_controldata checksum 
versions do not match\n");
 }
 
 
@@ -612,7 +612,7 @@ disable_old_cluster(void)
                                new_path[MAXPGPATH];
 
        /* rename pg_control so old server cannot be accidentally started */
-       prep_status("Adding \".old\" suffix to old global/pg_control");
+       prep_status("Adding \".old\" suffix to source global/pg_control");
 
        snprintf(old_path, sizeof(old_path), "%s/global/pg_control", 
old_cluster.pgdata);
        snprintf(new_path, sizeof(new_path), "%s/global/pg_control.old", 
old_cluster.pgdata);
@@ -621,8 +621,8 @@ disable_old_cluster(void)
        check_ok();
 
        pg_log(PG_REPORT, "\n"
-                  "If you want to start the old cluster, you will need to 
remove\n"
+                  "If you want to start the source cluster, you will need to 
remove\n"
                   "the \".old\" suffix from %s/global/pg_control.old.\n"
-                "Because \"link\" mode was used, the old cluster cannot be 
safely\n"
-       "started once the new cluster has been started.\n\n", 
old_cluster.pgdata);
+                "Because \"link\" mode was used, the source cluster cannot be 
safely\n"
+       "started once the target cluster has been started.\n\n", 
old_cluster.pgdata);
 }
diff --git a/src/bin/pg_upgrade/function.c b/src/bin/pg_upgrade/function.c
index 685d1de0b7..3efc39db63 100644
--- a/src/bin/pg_upgrade/function.c
+++ b/src/bin/pg_upgrade/function.c
@@ -33,7 +33,7 @@ library_name_compare(const void *p1, const void *p2)
        int                     slen1 = strlen(str1);
        int                     slen2 = strlen(str2);
 
-       if (slen1 != slen2)
+       target (slen1 != slen2)
                return slen1 - slen2;
        return strcmp(str1, str2);
 }
@@ -107,7 +107,7 @@ get_loadable_libraries(void)
                                if (!found_public_plpython_handler)
                                {
                                        pg_log(PG_WARNING,
-                                                  "\nThe old cluster has a 
\"plpython_call_handler\" function defined\n"
+                                                  "\nThe source cluster has a 
\"plpython_call_handler\" function defined\n"
                                                   "in the \"public\" schema 
which is a duplicate of the one defined\n"
                                                   "in the \"pg_catalog\" 
schema.  You can confirm this by executing\n"
                                                   "in psql:\n"
@@ -135,7 +135,7 @@ get_loadable_libraries(void)
        }
 
        if (found_public_plpython_handler)
-               pg_fatal("Remove the problem functions from the old cluster to 
continue.\n");
+               pg_fatal("Remove the problem functions from the source cluster 
to continue.\n");
 
        /*
         * Now we want to remove duplicates across DBs and sort the library 
names
@@ -267,8 +267,8 @@ check_loadable_libraries(void)
                fclose(script);
                pg_log(PG_REPORT, "fatal\n");
                pg_fatal("Your installation references loadable libraries that 
are missing from the\n"
-                                "new installation.  You can add these 
libraries to the new installation,\n"
-                                "or remove the functions using them from the 
old installation.  A list of\n"
+                                "target installation.  You can add these 
libraries to the target installation,\n"
+                                "or remove the functions using them from the 
source installation.  A list of\n"
                                 "problem libraries is in the file:\n"
                                 "    %s\n\n", output_path);
        }
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 669524c74a..cad501b170 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -131,7 +131,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
                          strcmp(old_rel->nspname, "pg_toast") != 0)))
                {
                        pg_log(PG_WARNING, "Relation names for OID %u in 
database \"%s\" do not match: "
-                                  "old name \"%s.%s\", new name \"%s.%s\"\n",
+                                  "source name \"%s.%s\", target name 
\"%s.%s\"\n",
                                   old_rel->reloid, old_db->db_name,
                                   old_rel->nspname, old_rel->relname,
                                   new_rel->nspname, new_rel->relname);
@@ -273,10 +273,10 @@ report_unmatched_relation(const RelInfo *rel, const 
DbInfo *db, bool is_new_db)
        }
 
        if (is_new_db)
-               pg_log(PG_WARNING, "No match found in old cluster for new 
relation with OID %u in database \"%s\": %s\n",
+               pg_log(PG_WARNING, "No match found in source cluster for target 
relation with OID %u in database \"%s\": %s\n",
                           reloid, db->db_name, reldesc);
        else
-               pg_log(PG_WARNING, "No match found in new cluster for old 
relation with OID %u in database \"%s\": %s\n",
+               pg_log(PG_WARNING, "No match found in target cluster for source 
relation with OID %u in database \"%s\": %s\n",
                           reloid, db->db_name, reldesc);
 }
 
diff --git a/src/bin/pg_upgrade/option.c b/src/bin/pg_upgrade/option.c
index 1406c5b46f..2a661ae52c 100644
--- a/src/bin/pg_upgrade/option.c
+++ b/src/bin/pg_upgrade/option.c
@@ -169,7 +169,7 @@ parseCommandLine(int argc, char *argv[])
                        case 'p':
                                if ((old_cluster.port = atoi(optarg)) <= 0)
                                {
-                                       pg_fatal("invalid old port number\n");
+                                       pg_fatal("invalid source port 
number\n");
                                        exit(1);
                                }
                                break;
@@ -177,7 +177,7 @@ parseCommandLine(int argc, char *argv[])
                        case 'P':
                                if ((new_cluster.port = atoi(optarg)) <= 0)
                                {
-                                       pg_fatal("invalid new port number\n");
+                                       pg_fatal("invalid target port 
number\n");
                                        exit(1);
                                }
                                break;
@@ -239,13 +239,13 @@ parseCommandLine(int argc, char *argv[])
 
        /* Get values from env if not already set */
        check_required_directory(&old_cluster.bindir, NULL, "PGBINOLD", "-b",
-                                                        _("old cluster 
binaries reside"));
+                                                        _("source cluster 
binaries reside"));
        check_required_directory(&new_cluster.bindir, NULL, "PGBINNEW", "-B",
-                                                        _("new cluster 
binaries reside"));
+                                                        _("target cluster 
binaries reside"));
        check_required_directory(&old_cluster.pgdata, &old_cluster.pgconfig,
-                                                  "PGDATAOLD", "-d", _("old 
cluster data resides"));
+                                                  "PGDATAOLD", "-d", _("source 
cluster data resides"));
        check_required_directory(&new_cluster.pgdata, &new_cluster.pgconfig,
-                                                  "PGDATANEW", "-D", _("new 
cluster data resides"));
+                                                  "PGDATANEW", "-D", _("target 
cluster data resides"));
 
 #ifdef WIN32
 
@@ -265,7 +265,7 @@ parseCommandLine(int argc, char *argv[])
                        pg_fatal("cannot find current directory\n");
                canonicalize_path(cwd);
                if (path_is_prefix_of_path(new_cluster_pgdata, cwd))
-                       pg_fatal("cannot run pg_upgrade from inside the new 
cluster data directory on Windows\n");
+                       pg_fatal("cannot run pg_upgrade from inside the target 
cluster data directory on Windows\n");
        }
 #endif
 }
@@ -296,30 +296,30 @@ usage(void)
        printf(_("  -?, --help                    show this help, then 
exit\n"));
        printf(_("\n"
                         "Before running pg_upgrade you must:\n"
-               "  create a new database cluster (using the new version of 
initdb)\n"
-                        "  shutdown the postmaster servicing the old cluster\n"
-                        "  shutdown the postmaster servicing the new 
cluster\n"));
+               "  create a target database cluster (using the target version 
of initdb)\n"
+                        "  shutdown the postmaster servicing the source 
cluster\n"
+                        "  shutdown the postmaster servicing the target 
cluster\n"));
        printf(_("\n"
         "When you run pg_upgrade, you must provide the following 
information:\n"
-                        "  the data directory for the old cluster  (-d 
DATADIR)\n"
-                        "  the data directory for the new cluster  (-D 
DATADIR)\n"
-                        "  the \"bin\" directory for the old version (-b 
BINDIR)\n"
-                        "  the \"bin\" directory for the new version (-B 
BINDIR)\n"));
+                        "  the data directory for the source cluster  (-d 
DATADIR)\n"
+                        "  the data directory for the target cluster  (-D 
DATADIR)\n"
+                        "  the \"bin\" directory for the source version (-b 
BINDIR)\n"
+                        "  the \"bin\" directory for the target version (-B 
BINDIR)\n"));
        printf(_("\n"
                         "For example:\n"
-                        "  pg_upgrade -d oldCluster/data -D newCluster/data -b 
oldCluster/bin -B newCluster/bin\n"
+                        "  pg_upgrade -d srcCluster/data -D tgtCluster/data -b 
srcCluster/bin -B tgtCluster/bin\n"
                         "or\n"));
 #ifndef WIN32
-       printf(_("  $ export PGDATAOLD=oldCluster/data\n"
-                        "  $ export PGDATANEW=newCluster/data\n"
-                        "  $ export PGBINOLD=oldCluster/bin\n"
-                        "  $ export PGBINNEW=newCluster/bin\n"
+       printf(_("  $ export PGDATAOLD=srcCluster/data\n"
+                        "  $ export PGDATANEW=tgtCluster/data\n"
+                        "  $ export PGBINOLD=srcCluster/bin\n"
+                        "  $ export PGBINNEW=tgtCluster/bin\n"
                         "  $ pg_upgrade\n"));
 #else
-       printf(_("  C:\\> set PGDATAOLD=oldCluster/data\n"
-                        "  C:\\> set PGDATANEW=newCluster/data\n"
-                        "  C:\\> set PGBINOLD=oldCluster/bin\n"
-                        "  C:\\> set PGBINNEW=newCluster/bin\n"
+       printf(_("  C:\\> set PGDATAOLD=srcCluster/data\n"
+                        "  C:\\> set PGDATANEW=tgtCluster/data\n"
+                        "  C:\\> set PGBINOLD=srcCluster/bin\n"
+                        "  C:\\> set PGBINNEW=tgtCluster/bin\n"
                         "  C:\\> pg_upgrade\n"));
 #endif
        printf(_("\nReport bugs to <pgsql-b...@postgresql.org>.\n"));
@@ -501,7 +501,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
 
                        /* warn of port number correction */
                        if (orig_port != DEF_PGUPORT && old_cluster.port != 
orig_port)
-                               pg_log(PG_WARNING, "User-supplied old port 
number %hu corrected to %hu\n",
+                               pg_log(PG_WARNING, "User-supplied source port 
number %hu corrected to %hu\n",
                                           orig_port, cluster->port);
                }
        }
diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index ca1aa5cbb8..25e3ef2074 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -146,7 +146,7 @@ main(int argc, char **argv)
         * the old system, but we do it anyway just in case.  We do it late here
         * because there is no need to have the schema load use new oids.
         */
-       prep_status("Setting next OID for new cluster");
+       prep_status("Setting next OID for target cluster");
        exec_prog(UTILITY_LOG_FILE, NULL, true,
                          "\"%s/pg_resetwal\" -o %u \"%s\"",
                          new_cluster.bindir, 
old_cluster.controldata.chkpnt_nxtoid,
@@ -208,7 +208,7 @@ setup(char *argv0, bool *live_check)
                else
                {
                        if (!user_opts.check)
-                               pg_fatal("There seems to be a postmaster 
servicing the old cluster.\n"
+                               pg_fatal("There seems to be a postmaster 
servicing the source cluster.\n"
                                                 "Please shutdown that 
postmaster and try again.\n");
                        else
                                *live_check = true;
@@ -221,7 +221,7 @@ setup(char *argv0, bool *live_check)
                if (start_postmaster(&new_cluster, false))
                        stop_postmaster(false);
                else
-                       pg_fatal("There seems to be a postmaster servicing the 
new cluster.\n"
+                       pg_fatal("There seems to be a postmaster servicing the 
target cluster.\n"
                                         "Please shutdown that postmaster and 
try again.\n");
        }
 
@@ -244,7 +244,7 @@ prepare_new_cluster(void)
         * would cause us to lose the frozenids restored by the load. We use
         * --analyze so autovacuum doesn't update statistics later
         */
-       prep_status("Analyzing all rows in the new cluster");
+       prep_status("Analyzing all rows in the target cluster");
        exec_prog(UTILITY_LOG_FILE, NULL, true,
                          "\"%s/vacuumdb\" %s --all --analyze %s",
                          new_cluster.bindir, cluster_conn_opts(&new_cluster),
@@ -257,7 +257,7 @@ prepare_new_cluster(void)
         * datfrozenxid, relfrozenxids, and relminmxid later to match the new 
xid
         * counter later.
         */
-       prep_status("Freezing all rows on the new cluster");
+       prep_status("Freezing all rows on the target cluster");
        exec_prog(UTILITY_LOG_FILE, NULL, true,
                          "\"%s/vacuumdb\" %s --all --freeze %s",
                          new_cluster.bindir, cluster_conn_opts(&new_cluster),
@@ -277,7 +277,7 @@ prepare_new_databases(void)
 
        set_frozenxids(false);
 
-       prep_status("Restoring global objects in the new cluster");
+       prep_status("Restoring global objects in the target cluster");
 
        /*
         * We have to create the databases first so we can install support
@@ -301,7 +301,7 @@ create_new_objects(void)
 {
        int                     dbnum;
 
-       prep_status("Restoring database schemas in the new cluster\n");
+       prep_status("Restoring database schemas in the target cluster\n");
 
        for (dbnum = 0; dbnum < old_cluster.dbarr.ndbs; dbnum++)
        {
@@ -363,7 +363,7 @@ remove_new_subdir(char *subdir, bool rmtopdir)
 {
        char            new_path[MAXPGPATH];
 
-       prep_status("Deleting files from new %s", subdir);
+       prep_status("Deleting files from target %s", subdir);
 
        snprintf(new_path, sizeof(new_path), "%s/%s", new_cluster.pgdata, 
subdir);
        if (!rmtree(new_path, rmtopdir))
@@ -386,7 +386,7 @@ copy_subdir_files(char *old_subdir, char *new_subdir)
        snprintf(old_path, sizeof(old_path), "%s/%s", old_cluster.pgdata, 
old_subdir);
        snprintf(new_path, sizeof(new_path), "%s/%s", new_cluster.pgdata, 
new_subdir);
 
-       prep_status("Copying old %s to new server", old_subdir);
+       prep_status("Copying source %s to target server", old_subdir);
 
        exec_prog(UTILITY_LOG_FILE, NULL, true,
 #ifndef WIN32
@@ -413,7 +413,7 @@ copy_xact_xlog_xid(void)
                                          "pg_clog" : "pg_xact");
 
        /* set the next transaction id and epoch of the new cluster */
-       prep_status("Setting next transaction ID and epoch for new cluster");
+       prep_status("Setting next transaction ID and epoch for target cluster");
        exec_prog(UTILITY_LOG_FILE, NULL, true,
                          "\"%s/pg_resetwal\" -f -x %u \"%s\"",
                          new_cluster.bindir, 
old_cluster.controldata.chkpnt_nxtxid,
@@ -443,7 +443,7 @@ copy_xact_xlog_xid(void)
                copy_subdir_files("pg_multixact/offsets", 
"pg_multixact/offsets");
                copy_subdir_files("pg_multixact/members", 
"pg_multixact/members");
 
-               prep_status("Setting next multixact ID and offset for new 
cluster");
+               prep_status("Setting next multixact ID and offset for target 
cluster");
 
                /*
                 * we preserve all files and contents, so we must preserve both 
"next"
@@ -467,7 +467,7 @@ copy_xact_xlog_xid(void)
                 */
                remove_new_subdir("pg_multixact/offsets", false);
 
-               prep_status("Setting oldest multixact ID on new cluster");
+               prep_status("Setting oldest multixact ID on target cluster");
 
                /*
                 * We don't preserve files in this case, but it's important 
that the
@@ -519,9 +519,9 @@ set_frozenxids(bool minmxid_only)
        int                     i_datallowconn;
 
        if (!minmxid_only)
-               prep_status("Setting frozenxid and minmxid counters in new 
cluster");
+               prep_status("Setting frozenxid and minmxid counters in target 
cluster");
        else
-               prep_status("Setting minmxid counter in new cluster");
+               prep_status("Setting minmxid counter in target cluster");
 
        conn_template1 = connectToServer(&new_cluster, "template1");
 
diff --git a/src/bin/pg_upgrade/relfilenode.c b/src/bin/pg_upgrade/relfilenode.c
index 06d3ed04a7..b5ce086e9a 100644
--- a/src/bin/pg_upgrade/relfilenode.c
+++ b/src/bin/pg_upgrade/relfilenode.c
@@ -107,7 +107,7 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr 
*new_db_arr,
                }
 
                if (new_dbnum >= new_db_arr->ndbs)
-                       pg_fatal("old database \"%s\" not found in the new 
cluster\n",
+                       pg_fatal("source database \"%s\" not found in the 
target cluster\n",
                                         old_db->db_name);
 
                mappings = gen_db_file_maps(old_db, new_db, &n_maps, old_pgdata,
diff --git a/src/bin/pg_upgrade/version.c b/src/bin/pg_upgrade/version.c
index 814eaa522c..f5d7f02f31 100644
--- a/src/bin/pg_upgrade/version.c
+++ b/src/bin/pg_upgrade/version.c
@@ -80,13 +80,13 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo 
*cluster, bool check_mode)
                report_status(PG_WARNING, "warning");
                if (check_mode)
                        pg_log(PG_WARNING, "\n"
-                                  "Your installation contains large objects.  
The new database has an\n"
+                                  "Your installation contains large objects.  
The target database has an\n"
                                   "additional large object permission table.  
After upgrading, you will be\n"
                                   "given a command to populate the 
pg_largeobject permission table with\n"
                                   "default permissions.\n\n");
                else
                        pg_log(PG_WARNING, "\n"
-                                  "Your installation contains large objects.  
The new database has an\n"
+                                  "Your installation contains large objects.  
The target database has an\n"
                                   "additional large object permission table, 
so default permissions must be\n"
                                   "defined for all large objects.  The file\n"
                                   "    %s\n"
@@ -178,8 +178,8 @@ old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster)
        {
                pg_log(PG_REPORT, "fatal\n");
                pg_fatal("Your installation contains the \"line\" data type in 
user tables.  This\n"
-                                "data type changed its internal and 
input/output format between your old\n"
-                                "and new clusters so this cluster cannot 
currently be upgraded.  You can\n"
+                                "data type changed its internal and 
input/output format between your source\n"
+                                "and target clusters so this cluster cannot 
currently be upgraded.  You can\n"
                                 "remove the problem tables and restart the 
upgrade.  A list of the problem\n"
                                 "columns is in the file:\n"
                                 "    %s\n\n", output_path);
@@ -383,13 +383,13 @@ old_9_6_invalidate_hash_indexes(ClusterInfo *cluster, 
bool check_mode)
                if (check_mode)
                        pg_log(PG_WARNING, "\n"
                                   "Your installation contains hash indexes.  
These indexes have different\n"
-                                  "internal formats between your old and new 
clusters, so they must be\n"
+                                  "internal formats between your source and 
target clusters, so they must be\n"
                                   "reindexed with the REINDEX command.  After 
upgrading, you will be given\n"
                                   "REINDEX instructions.\n\n");
                else
                        pg_log(PG_WARNING, "\n"
                                   "Your installation contains hash indexes.  
These indexes have different\n"
-                                  "internal formats between your old and new 
clusters, so they must be\n"
+                                  "internal formats between your source and 
target clusters, so they must be\n"
                                   "reindexed with the REINDEX command.  The 
file:\n"
                                   "    %s\n"
                                   "when executed by psql by the database 
superuser will recreate all invalid\n"
-- 
2.11.0

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to