@@ -52,9 +52,6 @@ static void set_frozenxids(void);
52
52
static void setup (char * argv0 , bool live_check );
53
53
static void cleanup (void );
54
54
55
- /* This is the database used by pg_dumpall to restore global tables */
56
- #define GLOBAL_DUMP_DB "postgres"
57
-
58
55
ClusterInfo old_cluster ,
59
56
new_cluster ;
60
57
OSInfo os_info ;
@@ -233,10 +230,12 @@ prepare_new_databases(void)
233
230
prep_status ("Creating databases in the new cluster" );
234
231
235
232
/*
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.
238
237
*/
239
- install_support_functions_in_new_db (GLOBAL_DUMP_DB );
238
+ install_support_functions_in_new_db ("template1" );
240
239
241
240
/*
242
241
* We have to create the databases first so we can install support
@@ -270,7 +269,7 @@ create_new_objects(void)
270
269
DbInfo * new_db = & new_cluster .dbarr .dbs [dbnum ];
271
270
272
271
/* 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 )
274
273
install_support_functions_in_new_db (new_db -> db_name );
275
274
}
276
275
check_ok ();
0 commit comments