aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2011-01-31 20:15:43 -0500
committerBruce Momjian <bruce@momjian.us>2011-01-31 20:16:15 -0500
commit6238473adb119a5a11061e40e159e8c5187fe492 (patch)
tree0ca954bf414003114bfe64c112cf1654ab4e0eac
parent9e95c9ad558bafa26efbab50f77929de4ade5f90 (diff)
downloadpostgresql-6238473adb119a5a11061e40e159e8c5187fe492.tar.gz
postgresql-6238473adb119a5a11061e40e159e8c5187fe492.zip
Fix pg_upgrade to create pg_authid restore functions in the 'postgres'
database, not in the os-user database, per report from Magnus.
-rw-r--r--contrib/pg_upgrade/pg_upgrade.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
index 294f58beaa6..d3e1fefa40a 100644
--- a/contrib/pg_upgrade/pg_upgrade.c
+++ b/contrib/pg_upgrade/pg_upgrade.c
@@ -50,6 +50,9 @@ static void set_frozenxids(void);
static void setup(char *argv0, bool live_check);
static void cleanup(void);
+/* This is the database used by pg_dumpall to restore global tables */
+#define GLOBAL_DUMP_DB "postgres"
+
ClusterInfo old_cluster, new_cluster;
OSInfo os_info;
@@ -226,10 +229,10 @@ prepare_new_databases(void)
prep_status("Creating databases in the new cluster");
/*
- * Install support functions in the database accessed by
- * GLOBALS_DUMP_FILE because it can preserve pg_authid.oid.
+ * Install support functions in the global-restore database
+ * to preserve pg_authid.oid.
*/
- install_support_functions_in_new_db(os_info.user);
+ install_support_functions_in_new_db(GLOBAL_DUMP_DB);
/*
* We have to create the databases first so we can install support
@@ -266,7 +269,7 @@ create_new_objects(void)
DbInfo *new_db = &new_cluster.dbarr.dbs[dbnum];
/* skip db we already installed */
- if (strcmp(new_db->db_name, os_info.user) != 0)
+ if (strcmp(new_db->db_name, GLOBAL_DUMP_DB) != 0)
install_support_functions_in_new_db(new_db->db_name);
}
check_ok();