73 lines
2.6 KiB
Diff
73 lines
2.6 KiB
Diff
Patch pg_upgrade to not insist on useless baggage in the upgrade RPM,
|
|
as well as being more careful to check for things it does need.
|
|
|
|
|
|
diff -Naur postgresql-9.0.2.orig/contrib/pg_upgrade/exec.c postgresql-9.0.2/contrib/pg_upgrade/exec.c
|
|
--- postgresql-9.0.2.orig/contrib/pg_upgrade/exec.c 2010-12-13 21:55:50.000000000 -0500
|
|
+++ postgresql-9.0.2/contrib/pg_upgrade/exec.c 2010-12-28 16:56:05.734506648 -0500
|
|
@@ -14,7 +14,7 @@
|
|
|
|
|
|
static void check_data_dir(migratorContext *ctx, const char *pg_data);
|
|
-static void check_bin_dir(migratorContext *ctx, ClusterInfo *cluster);
|
|
+static void check_bin_dir(migratorContext *ctx, ClusterInfo *cluster, Cluster whichCluster);
|
|
static int check_exec(migratorContext *ctx, const char *dir, const char *cmdName);
|
|
static const char *validate_exec(const char *path);
|
|
|
|
@@ -99,7 +99,7 @@
|
|
check_ok(ctx);
|
|
|
|
prep_status(ctx, "Checking old bin directory (%s)", ctx->old.bindir);
|
|
- check_bin_dir(ctx, &ctx->old);
|
|
+ check_bin_dir(ctx, &ctx->old, CLUSTER_OLD);
|
|
check_ok(ctx);
|
|
|
|
prep_status(ctx, "Checking new data directory (%s)", ctx->new.pgdata);
|
|
@@ -107,7 +107,7 @@
|
|
check_ok(ctx);
|
|
|
|
prep_status(ctx, "Checking new bin directory (%s)", ctx->new.bindir);
|
|
- check_bin_dir(ctx, &ctx->new);
|
|
+ check_bin_dir(ctx, &ctx->new, CLUSTER_NEW);
|
|
check_ok(ctx);
|
|
}
|
|
|
|
@@ -158,12 +158,18 @@
|
|
* exit().
|
|
*/
|
|
static void
|
|
-check_bin_dir(migratorContext *ctx, ClusterInfo *cluster)
|
|
+check_bin_dir(migratorContext *ctx, ClusterInfo *cluster, Cluster whichCluster)
|
|
{
|
|
check_exec(ctx, cluster->bindir, "postgres");
|
|
- check_exec(ctx, cluster->bindir, "psql");
|
|
check_exec(ctx, cluster->bindir, "pg_ctl");
|
|
- check_exec(ctx, cluster->bindir, "pg_dumpall");
|
|
+ check_exec(ctx, cluster->bindir, "pg_resetxlog");
|
|
+ if (whichCluster == CLUSTER_NEW)
|
|
+ {
|
|
+ /* these are only needed in the new cluster */
|
|
+ check_exec(ctx, cluster->bindir, "pg_config");
|
|
+ check_exec(ctx, cluster->bindir, "psql");
|
|
+ check_exec(ctx, cluster->bindir, "pg_dumpall");
|
|
+ }
|
|
}
|
|
|
|
|
|
diff -Naur postgresql-9.0.2.orig/contrib/pg_upgrade/option.c postgresql-9.0.2/contrib/pg_upgrade/option.c
|
|
--- postgresql-9.0.2.orig/contrib/pg_upgrade/option.c 2010-12-13 21:55:50.000000000 -0500
|
|
+++ postgresql-9.0.2/contrib/pg_upgrade/option.c 2010-12-28 16:53:44.730531216 -0500
|
|
@@ -308,7 +308,11 @@
|
|
static void
|
|
get_pkglibdirs(migratorContext *ctx)
|
|
{
|
|
- ctx->old.libpath = get_pkglibdir(ctx, ctx->old.bindir);
|
|
+ /*
|
|
+ * we do not need to know the libpath in the old cluster, and might not
|
|
+ * have a working pg_config to ask for it anyway.
|
|
+ */
|
|
+ ctx->old.libpath = NULL;
|
|
ctx->new.libpath = get_pkglibdir(ctx, ctx->new.bindir);
|
|
}
|
|
|