summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2011-01-08 14:11:48 +0000
committerBruce Momjian2011-01-08 14:11:48 +0000
commitebaf648ad2e471b2e2003ecfe4740ce27226c02a (patch)
tree6dab82d9bb2438dff2f7f02ddf30ad11bb06d60a
parenta60b32b3dcb4d49a60c96558ce405764ac17c799 (diff)
In pg_upgrade, clarify use of install_db_support_functions().
-rw-r--r--contrib/pg_upgrade/function.c4
-rw-r--r--contrib/pg_upgrade/pg_upgrade.c11
-rw-r--r--contrib/pg_upgrade/pg_upgrade.h2
3 files changed, 11 insertions, 6 deletions
diff --git a/contrib/pg_upgrade/function.c b/contrib/pg_upgrade/function.c
index e8502e2bb2..cb9576aff4 100644
--- a/contrib/pg_upgrade/function.c
+++ b/contrib/pg_upgrade/function.c
@@ -13,13 +13,13 @@
/*
- * install_db_support_functions()
+ * install_support_functions_in_db()
*
* pg_upgrade requires some support functions that enable it to modify
* backend behavior.
*/
void
-install_db_support_functions(const char *db_name)
+install_support_functions_in_db(const char *db_name)
{
PGconn *conn = connectToServer(&new_cluster, db_name);
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
index 331ade1076..a428a038bc 100644
--- a/contrib/pg_upgrade/pg_upgrade.c
+++ b/contrib/pg_upgrade/pg_upgrade.c
@@ -225,8 +225,11 @@ prepare_new_databases(void)
prep_status("Creating databases in the new cluster");
- /* install support functions in the database used by GLOBALS_DUMP_FILE */
- install_db_support_functions(os_info.user);
+ /*
+ * Install support functions in the database accessed by
+ * GLOBALS_DUMP_FILE because it can preserve pg_authid.oid.
+ */
+ install_support_functions_in_db(os_info.user);
/*
* We have to create the databases first so we can install support
@@ -261,7 +264,9 @@ create_new_objects(void)
{
DbInfo *new_db = &new_cluster.dbarr.dbs[dbnum];
- install_db_support_functions(new_db->db_name);
+ /* skip db we already installed */
+ if (strcmp(new_db->db_name, os_info.user) != 0)
+ install_support_functions_in_db(new_db->db_name);
}
check_ok();
diff --git a/contrib/pg_upgrade/pg_upgrade.h b/contrib/pg_upgrade/pg_upgrade.h
index 95db4dd161..acd453b895 100644
--- a/contrib/pg_upgrade/pg_upgrade.h
+++ b/contrib/pg_upgrade/pg_upgrade.h
@@ -321,7 +321,7 @@ void check_hard_link(void);
/* function.c */
-void install_db_support_functions(const char *db_name);
+void install_support_functions_in_db(const char *db_name);
void uninstall_support_functions(void);
void get_loadable_libraries(void);
void check_loadable_libraries(void);