diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
new file mode 100644
index 1a515e7..37d2eed
*** a/contrib/pg_upgrade/pg_upgrade.c
--- b/contrib/pg_upgrade/pg_upgrade.c
*************** prepare_new_cluster(migratorContext *ctx
*** 161,168 ****
  	prep_status(ctx, "Analyzing all rows in the new cluster");
  	exec_prog(ctx, true,
  			  SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" "
! 			  "--all --analyze >> %s 2>&1" SYSTEMQUOTE,
! 			  ctx->new.bindir, ctx->new.port, ctx->user, ctx->logfile);
  	check_ok(ctx);
  
  	/*
--- 161,174 ----
  	prep_status(ctx, "Analyzing all rows in the new cluster");
  	exec_prog(ctx, true,
  			  SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" "
! 			  "--all --analyze >> \"%s\" 2>&1" SYSTEMQUOTE,
! 			  ctx->new.bindir, ctx->new.port, ctx->user,
! #ifndef WIN32
! 			  ctx->logfile
! #else
! 			  DEVNULL
! #endif
! 			  );
  	check_ok(ctx);
  
  	/*
*************** prepare_new_cluster(migratorContext *ctx
*** 174,181 ****
  	prep_status(ctx, "Freezing all rows on the new cluster");
  	exec_prog(ctx, true,
  			  SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" "
! 			  "--all --freeze >> %s 2>&1" SYSTEMQUOTE,
! 			  ctx->new.bindir, ctx->new.port, ctx->user, ctx->logfile);
  	check_ok(ctx);
  
  	get_pg_database_relfilenode(ctx, CLUSTER_NEW);
--- 180,193 ----
  	prep_status(ctx, "Freezing all rows on the new cluster");
  	exec_prog(ctx, true,
  			  SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" "
! 			  "--all --freeze >> \"%s\" 2>&1" SYSTEMQUOTE,
! 			  ctx->new.bindir, ctx->new.port, ctx->user,
! #ifndef WIN32
! 			  ctx->logfile
! #else
! 			  DEVNULL
! #endif
! 			  );
  	check_ok(ctx);
  
  	get_pg_database_relfilenode(ctx, CLUSTER_NEW);
*************** prepare_new_databases(migratorContext *c
*** 207,213 ****
  			  "--no-psqlrc --port %d --username \"%s\" "
  			  "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
  			  ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
! 			  GLOBALS_DUMP_FILE, ctx->logfile);
  	check_ok(ctx);
  
  	get_db_and_rel_infos(ctx, &ctx->new.dbarr, CLUSTER_NEW);
--- 219,231 ----
  			  "--no-psqlrc --port %d --username \"%s\" "
  			  "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
  			  ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
! 			  GLOBALS_DUMP_FILE,
! #ifndef WIN32
! 			  ctx->logfile
! #else
! 			  DEVNULL
! #endif
! 			  );
  	check_ok(ctx);
  
  	get_db_and_rel_infos(ctx, &ctx->new.dbarr, CLUSTER_NEW);
*************** create_new_objects(migratorContext *ctx)
*** 230,236 ****
  			  "--no-psqlrc --port %d --username \"%s\" "
  			  "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
  			  ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
! 			  DB_DUMP_FILE, ctx->logfile);
  	check_ok(ctx);
  
  	/* regenerate now that we have db schemas */
--- 248,260 ----
  			  "--no-psqlrc --port %d --username \"%s\" "
  			  "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
  			  ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
! 			  DB_DUMP_FILE,
! #ifndef WIN32
! 			  ctx->logfile
! #else
! 			  DEVNULL
! #endif
! 			  );
  	check_ok(ctx);
  
  	/* regenerate now that we have db schemas */
*************** copy_clog_xlog_xid(migratorContext *ctx)
*** 282,288 ****
  	exec_prog(ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -l %u,%u,%u \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
  			  ctx->new.bindir, ctx->old.controldata.chkpnt_tli,
  			  ctx->old.controldata.logid, ctx->old.controldata.nxtlogseg,
! 			  ctx->new.pgdata, ctx->logfile);
  	check_ok(ctx);
  }
  
--- 306,318 ----
  	exec_prog(ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -l %u,%u,%u \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
  			  ctx->new.bindir, ctx->old.controldata.chkpnt_tli,
  			  ctx->old.controldata.logid, ctx->old.controldata.nxtlogseg,
! 			  ctx->new.pgdata,
! #ifndef WIN32
! 			  ctx->logfile
! #else
! 			  DEVNULL
! #endif
! 			  );
  	check_ok(ctx);
  }
  
