Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit88c8034

Browse files
committed
Improve pg_upgrade's checks for required executables.
Don't insist on pg_dumpall and psql being present in the old cluster,since they are not needed. Do insist on pg_resetxlog being present(in both old and new), since we need it. Also check for pg_config,but only in the new cluster. Remove the useless attempt to callpg_config in the old cluster; we don't need to know the old value of--pkglibdir. (In the case of a stripped-down migration installationthere might be nothing there to look at anyway, so any future changethat might reintroduce that need would have to be considered carefully.)Per my attempts to build a minimal previous-version installation to supportpg_upgrade.
1 parentd2bc1c9 commit88c8034

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

‎contrib/pg_upgrade/exec.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
staticvoidcheck_data_dir(constchar*pg_data);
17-
staticvoidcheck_bin_dir(ClusterInfo*cluster);
17+
staticvoidcheck_bin_dir(ClusterInfo*cluster,ClusterwhichCluster);
1818
staticintcheck_exec(constchar*dir,constchar*cmdName);
1919
staticconstchar*validate_exec(constchar*path);
2020

@@ -99,15 +99,15 @@ verify_directories(void)
9999
check_ok();
100100

101101
prep_status("Checking old bin directory (%s)",old_cluster.bindir);
102-
check_bin_dir(&old_cluster);
102+
check_bin_dir(&old_cluster,CLUSTER_OLD);
103103
check_ok();
104104

105105
prep_status("Checking new data directory (%s)",new_cluster.pgdata);
106106
check_data_dir(new_cluster.pgdata);
107107
check_ok();
108108

109109
prep_status("Checking new bin directory (%s)",new_cluster.bindir);
110-
check_bin_dir(&new_cluster);
110+
check_bin_dir(&new_cluster,CLUSTER_NEW);
111111
check_ok();
112112
}
113113

@@ -158,12 +158,18 @@ check_data_dir(const char *pg_data)
158158
*exit().
159159
*/
160160
staticvoid
161-
check_bin_dir(ClusterInfo*cluster)
161+
check_bin_dir(ClusterInfo*cluster,ClusterwhichCluster)
162162
{
163163
check_exec(cluster->bindir,"postgres");
164-
check_exec(cluster->bindir,"psql");
165164
check_exec(cluster->bindir,"pg_ctl");
166-
check_exec(cluster->bindir,"pg_dumpall");
165+
check_exec(cluster->bindir,"pg_resetxlog");
166+
if (whichCluster==CLUSTER_NEW)
167+
{
168+
/* these are only needed in the new cluster */
169+
check_exec(cluster->bindir,"pg_config");
170+
check_exec(cluster->bindir,"psql");
171+
check_exec(cluster->bindir,"pg_dumpall");
172+
}
167173
}
168174

169175

‎contrib/pg_upgrade/option.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ validateDirectoryOption(char **dirpath,
310310
staticvoid
311311
get_pkglibdirs(void)
312312
{
313-
old_cluster.libpath=get_pkglibdir(old_cluster.bindir);
313+
/*
314+
* we do not need to know the libpath in the old cluster, and might not
315+
* have a working pg_config to ask for it anyway.
316+
*/
317+
old_cluster.libpath=NULL;
314318
new_cluster.libpath=get_pkglibdir(new_cluster.bindir);
315319
}
316320

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp