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

In pg_upgrade, remove use of whichCluster, and just pass old/new cluster

pointers, which simplifies the code.  This was not possible in 9.0 because
everything was in a single nested struct, but is possible now.

Per suggestion from Tom.
This commit is contained in:
Bruce Momjian
2011-01-01 12:06:36 -05:00
parent f82b3e58f8
commit 6e6bee987f
11 changed files with 181 additions and 227 deletions

View File

@ -14,7 +14,7 @@
static void check_data_dir(const char *pg_data);
static void check_bin_dir(ClusterInfo *cluster, Cluster whichCluster);
static void check_bin_dir(ClusterInfo *cluster);
static int check_exec(const char *dir, const char *cmdName);
static const char *validate_exec(const char *path);
@ -99,7 +99,7 @@ verify_directories(void)
check_ok();
prep_status("Checking old bin directory (%s)", old_cluster.bindir);
check_bin_dir(&old_cluster, CLUSTER_OLD);
check_bin_dir(&old_cluster);
check_ok();
prep_status("Checking new data directory (%s)", new_cluster.pgdata);
@ -107,7 +107,7 @@ verify_directories(void)
check_ok();
prep_status("Checking new bin directory (%s)", new_cluster.bindir);
check_bin_dir(&new_cluster, CLUSTER_NEW);
check_bin_dir(&new_cluster);
check_ok();
}
@ -158,12 +158,12 @@ check_data_dir(const char *pg_data)
* exit().
*/
static void
check_bin_dir(ClusterInfo *cluster, Cluster whichCluster)
check_bin_dir(ClusterInfo *cluster)
{
check_exec(cluster->bindir, "postgres");
check_exec(cluster->bindir, "pg_ctl");
check_exec(cluster->bindir, "pg_resetxlog");
if (whichCluster == CLUSTER_NEW)
if (cluster == &new_cluster)
{
/* these are only needed in the new cluster */
check_exec(cluster->bindir, "pg_config");