diff options
Diffstat (limited to 'contrib/pg_upgrade/pg_upgrade.c')
-rw-r--r-- | contrib/pg_upgrade/pg_upgrade.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c index c47c8bba445..ee3a1517f49 100644 --- a/contrib/pg_upgrade/pg_upgrade.c +++ b/contrib/pg_upgrade/pg_upgrade.c @@ -88,6 +88,9 @@ main(int argc, char **argv) check_cluster_versions(); check_cluster_compatibility(live_check); + get_sock_dir(&old_cluster, live_check); + get_sock_dir(&new_cluster, false); + check_old_cluster(live_check, &sequence_script_file_name); @@ -211,8 +214,8 @@ prepare_new_cluster(void) */ prep_status("Analyzing all rows in the new cluster"); exec_prog(UTILITY_LOG_FILE, NULL, true, - "\"%s/vacuumdb\" --port %d --username \"%s\" --all --analyze %s", - new_cluster.bindir, new_cluster.port, os_info.user, + "\"%s/vacuumdb\" %s --all --analyze %s", + new_cluster.bindir, cluster_conn_opts(&new_cluster), log_opts.verbose ? "--verbose" : ""); check_ok(); @@ -224,8 +227,8 @@ prepare_new_cluster(void) */ prep_status("Freezing all rows on the new cluster"); exec_prog(UTILITY_LOG_FILE, NULL, true, - "\"%s/vacuumdb\" --port %d --username \"%s\" --all --freeze %s", - new_cluster.bindir, new_cluster.port, os_info.user, + "\"%s/vacuumdb\" %s --all --freeze %s", + new_cluster.bindir, cluster_conn_opts(&new_cluster), log_opts.verbose ? "--verbose" : ""); check_ok(); @@ -261,8 +264,8 @@ prepare_new_databases(void) * the template0 template. */ exec_prog(RESTORE_LOG_FILE, NULL, true, - "\"%s/psql\" " EXEC_PSQL_ARGS " --port %d --username \"%s\" -f \"%s\"", - new_cluster.bindir, new_cluster.port, os_info.user, + "\"%s/psql\" " EXEC_PSQL_ARGS " %s -f \"%s\"", + new_cluster.bindir, cluster_conn_opts(&new_cluster), GLOBALS_DUMP_FILE); check_ok(); @@ -290,8 +293,8 @@ create_new_objects(void) prep_status("Restoring database schema to new cluster"); exec_prog(RESTORE_LOG_FILE, NULL, true, - "\"%s/psql\" " EXEC_PSQL_ARGS " --port %d --username \"%s\" -f \"%s\"", - new_cluster.bindir, new_cluster.port, os_info.user, + "\"%s/psql\" " EXEC_PSQL_ARGS " %s -f \"%s\"", + new_cluster.bindir, cluster_conn_opts(&new_cluster), DB_DUMP_FILE); check_ok(); |