1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

In pg_upgrade, avoid one start/stop of the postmaster; use the -w

(wait) flag for pg_ctl start/stop;  remove the unused "quiet" flag in
the functions for starting/stopping the postmaster.
This commit is contained in:
Bruce Momjian
2011-04-25 20:17:48 -04:00
parent 6dab96abaa
commit 44091442db
4 changed files with 21 additions and 26 deletions

View File

@ -77,7 +77,7 @@ main(int argc, char **argv)
/* -- NEW -- */
start_postmaster(&new_cluster, false);
start_postmaster(&new_cluster);
check_new_cluster();
report_clusters_compatible();
@ -88,7 +88,7 @@ main(int argc, char **argv)
disable_old_cluster();
prepare_new_cluster();
stop_postmaster(false, false);
stop_postmaster(false);
/*
* Destructive Changes to New Cluster
@ -98,10 +98,15 @@ main(int argc, char **argv)
/* New now using xids of the old system */
/* -- NEW -- */
start_postmaster(&new_cluster);
prepare_new_databases();
create_new_objects();
stop_postmaster(false);
transfer_all_new_dbs(&old_cluster.dbarr, &new_cluster.dbarr,
old_cluster.pgdata, new_cluster.pgdata);
@ -216,9 +221,6 @@ prepare_new_cluster(void)
static void
prepare_new_databases(void)
{
/* -- NEW -- */
start_postmaster(&new_cluster, false);
/*
* We set autovacuum_freeze_max_age to its maximum value so autovacuum
* does not launch here and delete clog files, before the frozen xids are
@ -252,8 +254,6 @@ prepare_new_databases(void)
/* we load this to get a current list of databases */
get_db_and_rel_infos(&new_cluster);
stop_postmaster(false, false);
}
@ -262,9 +262,6 @@ create_new_objects(void)
{
int dbnum;
/* -- NEW -- */
start_postmaster(&new_cluster, false);
prep_status("Adding support functions to new cluster");
for (dbnum = 0; dbnum < new_cluster.dbarr.ndbs; dbnum++)
@ -290,8 +287,6 @@ create_new_objects(void)
get_db_and_rel_infos(&new_cluster);
uninstall_support_functions_from_new_cluster();
stop_postmaster(false, false);
}