File tree Expand file tree Collapse file tree 6 files changed +41
-17
lines changed Expand file tree Collapse file tree 6 files changed +41
-17
lines changed Original file line number Diff line number Diff line change @@ -770,8 +770,12 @@ check_for_prepared_transactions(ClusterInfo *cluster)
770
770
"FROM pg_catalog.pg_prepared_xacts" );
771
771
772
772
if (PQntuples (res ) != 0 )
773
- pg_fatal ("The %s cluster contains prepared transactions\n" ,
774
- CLUSTER_NAME (cluster ));
773
+ {
774
+ if (cluster == & old_cluster )
775
+ pg_fatal ("The source cluster contains prepared transactions\n" );
776
+ else
777
+ pg_fatal ("The target cluster contains prepared transactions\n" );
778
+ }
775
779
776
780
PQclear (res );
777
781
@@ -1082,8 +1086,12 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
1082
1086
"WHERE rolname ~ '^pg_'" );
1083
1087
1084
1088
if (PQntuples (res ) != 0 )
1085
- pg_fatal ("The %s cluster contains roles starting with 'pg_'\n" ,
1086
- CLUSTER_NAME (cluster ));
1089
+ {
1090
+ if (cluster == & old_cluster )
1091
+ pg_fatal ("The source cluster contains roles starting with 'pg_'\n" );
1092
+ else
1093
+ pg_fatal ("The target cluster contains roles starting with 'pg_'\n" );
1094
+ }
1087
1095
1088
1096
PQclear (res );
1089
1097
Original file line number Diff line number Diff line change @@ -474,9 +474,12 @@ get_control_data(ClusterInfo *cluster, bool live_check)
474
474
cluster -> controldata .ctrl_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER ) ||
475
475
!got_date_is_int || !got_data_checksum_version )
476
476
{
477
- pg_log (PG_REPORT ,
478
- "The %s cluster lacks some required control information:\n" ,
479
- CLUSTER_NAME (cluster ));
477
+ if (cluster == & old_cluster )
478
+ pg_log (PG_REPORT ,
479
+ "The source cluster lacks some required control information:\n" );
480
+ else
481
+ pg_log (PG_REPORT ,
482
+ "The target cluster lacks some required control information:\n" );
480
483
481
484
if (!got_xid )
482
485
pg_log (PG_REPORT , " checkpoint next XID\n" );
Original file line number Diff line number Diff line change @@ -320,7 +320,11 @@ get_db_and_rel_infos(ClusterInfo *cluster)
320
320
for (dbnum = 0 ; dbnum < cluster -> dbarr .ndbs ; dbnum ++ )
321
321
get_rel_infos (cluster , & cluster -> dbarr .dbs [dbnum ]);
322
322
323
- pg_log (PG_VERBOSE , "\n%s databases:\n" , CLUSTER_NAME (cluster ));
323
+ if (cluster == & old_cluster )
324
+ pg_log (PG_VERBOSE , "\nsource databases:\n" );
325
+ else
326
+ pg_log (PG_VERBOSE , "\ntarget databases:\n" );
327
+
324
328
if (log_opts .verbose )
325
329
print_db_infos (& cluster -> dbarr );
326
330
}
Original file line number Diff line number Diff line change @@ -405,8 +405,10 @@ adjust_data_dir(ClusterInfo *cluster)
405
405
406
406
/* Must be a configuration directory, so find the real data directory. */
407
407
408
- prep_status ("Finding the real data directory for the %s cluster" ,
409
- CLUSTER_NAME (cluster ));
408
+ if (cluster == & old_cluster )
409
+ prep_status ("Finding the real data directory for the source cluster" );
410
+ else
411
+ prep_status ("Finding the real data directory for the target cluster" );
410
412
411
413
/*
412
414
* We don't have a data directory yet, so we can't check the PG version,
Original file line number Diff line number Diff line change @@ -94,8 +94,6 @@ extern char *output_files[];
94
94
#define ECHO_BLANK "."
95
95
#endif
96
96
97
- #define CLUSTER_NAME (cluster ) ((cluster) == &old_cluster ? "old" : \
98
- (cluster) == &new_cluster ? "new" : "none")
99
97
100
98
/* OID system catalog preservation added during PG 9.0 development */
101
99
#define TABLE_SPACE_SUBDIRS_CAT_VER 201001111
Original file line number Diff line number Diff line change @@ -285,9 +285,14 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
285
285
PQerrorMessage (conn ));
286
286
if (conn )
287
287
PQfinish (conn );
288
- pg_fatal ("could not connect to %s postmaster started with the command:\n"
289
- "%s\n" ,
290
- CLUSTER_NAME (cluster ), cmd );
288
+ if (cluster == & old_cluster )
289
+ pg_fatal ("could not connect to source postmaster started with the command:\n"
290
+ "%s\n" ,
291
+ cmd );
292
+ else
293
+ pg_fatal ("could not connect to target postmaster started with the command:\n"
294
+ "%s\n" ,
295
+ cmd );
291
296
}
292
297
PQfinish (conn );
293
298
@@ -297,8 +302,12 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
297
302
* running.
298
303
*/
299
304
if (!pg_ctl_return )
300
- pg_fatal ("pg_ctl failed to start the %s server, or connection failed\n" ,
301
- CLUSTER_NAME (cluster ));
305
+ {
306
+ if (cluster == & old_cluster )
307
+ pg_fatal ("pg_ctl failed to start the source server, or connection failed\n" );
308
+ else
309
+ pg_fatal ("pg_ctl failed to start the target server, or connection failed\n" );
310
+ }
302
311
303
312
return true;
304
313
}
You can’t perform that action at this time.
0 commit comments