Commit 837255cc authored by Alvaro Herrera's avatar Alvaro Herrera

pg_upgrade i18n: Fix "%s server/cluster" wording

The original wording was impossible to translate correctly.

Discussion: https://postgr.es/m/20170523002827.lzc2jkzh2gubclqb@alvherre.pgsql
parent decb08eb
......@@ -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);
......
......@@ -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");
......
......@@ -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);
}
......
......@@ -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,
......
......@@ -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
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment