/* -- OLD -- */
if (!live_check)
- start_postmaster(&old_cluster, false);
+ start_postmaster(&old_cluster);
set_locale_and_encoding(&old_cluster);
}
if (!live_check)
- stop_postmaster(false, false);
+ stop_postmaster(false);
}
{
pg_log(PG_REPORT, "\n*Clusters are compatible*\n");
/* stops new cluster */
- stop_postmaster(false, false);
+ stop_postmaster(false);
exit(0);
}
/* old = PG 8.3 warnings? */
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
{
- start_postmaster(&new_cluster, true);
+ start_postmaster(&new_cluster);
/* restore proper sequence values using file created from old server */
if (sequence_script_file_name)
old_8_3_rebuild_tsvector_tables(&new_cluster, false);
old_8_3_invalidate_hash_gin_indexes(&new_cluster, false);
old_8_3_invalidate_bpchar_pattern_ops_indexes(&new_cluster, false);
- stop_postmaster(false, true);
+ stop_postmaster(false);
}
/* Create dummy large object permissions for old < PG 9.0? */
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 804)
{
- start_postmaster(&new_cluster, true);
+ start_postmaster(&new_cluster);
new_9_0_populate_pg_largeobject_metadata(&new_cluster, false);
- stop_postmaster(false, true);
+ stop_postmaster(false);
}
}
/* -- NEW -- */
- start_postmaster(&new_cluster, false);
+ start_postmaster(&new_cluster);
check_new_cluster();
report_clusters_compatible();
disable_old_cluster();
prepare_new_cluster();
- stop_postmaster(false, false);
+ stop_postmaster(false);
/*
* Destructive Changes to New Cluster
/* 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);
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
/* we load this to get a current list of databases */
get_db_and_rel_infos(&new_cluster);
-
- stop_postmaster(false, false);
}
{
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++)
get_db_and_rel_infos(&new_cluster);
uninstall_support_functions_from_new_cluster();
-
- stop_postmaster(false, false);
}
PGconn *connectToServer(ClusterInfo *cluster, const char *db_name);
PGresult *executeQueryOrDie(PGconn *conn, const char *fmt,...);
-void start_postmaster(ClusterInfo *cluster, bool quiet);
-void stop_postmaster(bool fast, bool quiet);
+void start_postmaster(ClusterInfo *cluster);
+void stop_postmaster(bool fast);
uint32 get_major_server_version(ClusterInfo *cluster);
void check_for_libpq_envvars(void);
stop_postmaster_on_exit(int exitstatus, void *arg)
#endif
{
- stop_postmaster(true, true);
+ stop_postmaster(true);
}
void
-start_postmaster(ClusterInfo *cluster, bool quiet)
+start_postmaster(ClusterInfo *cluster)
{
char cmd[MAXPGPATH];
const char *bindir;
* not touch them.
*/
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" "
+ SYSTEMQUOTE "\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" "
"-o \"-p %d %s\" start >> \"%s\" 2>&1" SYSTEMQUOTE,
bindir, output_filename, datadir, port,
(cluster->controldata.cat_ver >=
void
-stop_postmaster(bool fast, bool quiet)
+stop_postmaster(bool fast)
{
char cmd[MAXPGPATH];
const char *bindir;
/* See comment in start_postmaster() about why win32 output is ignored. */
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" %s stop >> "
+ SYSTEMQUOTE "\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" %s stop >> "
"\"%s\" 2>&1" SYSTEMQUOTE,
bindir,
#ifndef WIN32