@@ -50,6 +50,9 @@ static void set_frozenxids(void);
5050static void setup (char * argv0 , bool live_check );
5151static void cleanup (void );
5252
53+ /* This is the database used by pg_dumpall to restore global tables */
54+ #define GLOBAL_DUMP_DB "postgres"
55+
5356ClusterInfo old_cluster , new_cluster ;
5457OSInfo os_info ;
5558
@@ -226,10 +229,10 @@ prepare_new_databases(void)
226229 prep_status ("Creating databases in the new cluster" );
227230
228231 /*
229- * Install support functions in the database accessed by
230- * GLOBALS_DUMP_FILE because it can preserve pg_authid.oid.
232+ * Install support functions in the global-restore database
233+ * to preserve pg_authid.oid.
231234 */
232- install_support_functions_in_new_db (os_info . user );
235+ install_support_functions_in_new_db (GLOBAL_DUMP_DB );
233236
234237 /*
235238 * We have to create the databases first so we can install support
@@ -266,7 +269,7 @@ create_new_objects(void)
266269 DbInfo * new_db = & new_cluster .dbarr .dbs [dbnum ];
267270
268271 /* skip db we already installed */
269- if (strcmp (new_db -> db_name , os_info . user ) != 0 )
272+ if (strcmp (new_db -> db_name , GLOBAL_DUMP_DB ) != 0 )
270273 install_support_functions_in_new_db (new_db -> db_name );
271274 }
272275 check_ok ();
0 commit comments