pg_upgrade: print check output file location
The primary user of pg_upgrade is gpupgrade where users need to know the
full path location to the pg_upgrade check output files.
@@ -246,8 +246,16 @@ report_clusters_compatible(void)
{
if (user_opts.check)
{
- pg_log(PG_REPORT, (get_check_fatal_occurred() ?
- "\n*Some cluster objects are not compatible*\n" : "\n*Clusters are compatible*\n"));
+ if (get_check_fatal_occurred())
+ {
+ char cwd[MAXPGPATH];
+ if (!getcwd(cwd, MAXPGPATH))
+ pg_fatal("could not determine current directory: %m\n");
+ canonicalize_path(cwd);
+
+ pg_log(PG_REPORT, "\n*Some cluster objects are not compatible*\n\npg_upgrade check output files are located:\n%s\n\n", cwd);
+ } else
+ pg_log(PG_REPORT, "\n*Clusters are compatible*\n");
/* stops new cluster */
stop_postmaster(false);
