"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);
"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);
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");
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);
}
/* 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,
#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
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);
* 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;
}