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

Commit51eba98

Browse files
committed
Remove pg_upgrade dependency on the 'postgres' database existing in the
new cluster. vacuumdb, used by pg_upgrade, still has this dependency.
1 parent53f1ca5 commit51eba98

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

‎contrib/pg_upgrade/pg_upgrade.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ static void set_frozenxids(void);
5252
staticvoidsetup(char*argv0,boollive_check);
5353
staticvoidcleanup(void);
5454

55-
/* This is the database used by pg_dumpall to restore global tables */
56-
#defineGLOBAL_DUMP_DB"postgres"
57-
5855
ClusterInfoold_cluster,
5956
new_cluster;
6057
OSInfoos_info;
@@ -233,10 +230,12 @@ prepare_new_databases(void)
233230
prep_status("Creating databases in the new cluster");
234231

235232
/*
236-
* Install support functions in the global-restore database to preserve
237-
* pg_authid.oid.
233+
* Install support functions in the global-object restore database to
234+
* preserve pg_authid.oid. pg_dumpall uses 'template0' as its template
235+
* database so objects we add into 'template1' are not propogated. They
236+
* are removed on pg_upgrade exit.
238237
*/
239-
install_support_functions_in_new_db(GLOBAL_DUMP_DB);
238+
install_support_functions_in_new_db("template1");
240239

241240
/*
242241
* We have to create the databases first so we can install support
@@ -270,7 +269,7 @@ create_new_objects(void)
270269
DbInfo*new_db=&new_cluster.dbarr.dbs[dbnum];
271270

272271
/* skip db we already installed */
273-
if (strcmp(new_db->db_name,GLOBAL_DUMP_DB)!=0)
272+
if (strcmp(new_db->db_name,"template1")!=0)
274273
install_support_functions_in_new_db(new_db->db_name);
275274
}
276275
check_ok();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp