aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/pg_upgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_upgrade/pg_upgrade.c')
-rw-r--r--src/bin/pg_upgrade/pg_upgrade.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index 3628bd74a7b..f85cb2e2620 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -169,11 +169,14 @@ main(int argc, char **argv)
new_cluster.pgdata);
check_ok();
- prep_status("Sync data directory to disk");
- exec_prog(UTILITY_LOG_FILE, NULL, true, true,
- "\"%s/initdb\" --sync-only \"%s\"", new_cluster.bindir,
- new_cluster.pgdata);
- check_ok();
+ if (user_opts.do_sync)
+ {
+ prep_status("Sync data directory to disk");
+ exec_prog(UTILITY_LOG_FILE, NULL, true, true,
+ "\"%s/initdb\" --sync-only \"%s\"", new_cluster.bindir,
+ new_cluster.pgdata);
+ check_ok();
+ }
create_script_for_old_cluster_deletion(&deletion_script_file_name);