Skip to content

Commit 6238473

Browse files
committed
Fix pg_upgrade to create pg_authid restore functions in the 'postgres'
database, not in the os-user database, per report from Magnus.
1 parent 9e95c9a commit 6238473

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

contrib/pg_upgrade/pg_upgrade.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ static void set_frozenxids(void);
5050
static void setup(char *argv0, bool live_check);
5151
static void cleanup(void);
5252

53+
/* This is the database used by pg_dumpall to restore global tables */
54+
#define GLOBAL_DUMP_DB "postgres"
55+
5356
ClusterInfo old_cluster, new_cluster;
5457
OSInfo 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

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy