Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 51eba98

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 parent 53f1ca5 commit 51eba98

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

contrib/pg_upgrade/pg_upgrade.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ static void set_frozenxids(void);
5252
static void setup(char *argv0, bool live_check);
5353
static void cleanup(void);
5454

55-
/* This is the database used by pg_dumpall to restore global tables */
56-
#define GLOBAL_DUMP_DB "postgres"
57-
5855
ClusterInfo old_cluster,
5956
new_cluster;
6057
OSInfo os_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)