Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ebaf648

Browse files
committed
In pg_upgrade, clarify use of install_db_support_functions().
1 parent a60b32b commit ebaf648

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

contrib/pg_upgrade/function.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414

1515
/*
16-
* install_db_support_functions()
16+
* install_support_functions_in_db()
1717
*
1818
* pg_upgrade requires some support functions that enable it to modify
1919
* backend behavior.
2020
*/
2121
void
22-
install_db_support_functions(const char *db_name)
22+
install_support_functions_in_db(const char *db_name)
2323
{
2424
PGconn *conn = connectToServer(&new_cluster, db_name);
2525

contrib/pg_upgrade/pg_upgrade.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,11 @@ prepare_new_databases(void)
225225

226226
prep_status("Creating databases in the new cluster");
227227

228-
/* install support functions in the database used by GLOBALS_DUMP_FILE */
229-
install_db_support_functions(os_info.user);
228+
/*
229+
* Install support functions in the database accessed by
230+
* GLOBALS_DUMP_FILE because it can preserve pg_authid.oid.
231+
*/
232+
install_support_functions_in_db(os_info.user);
230233

231234
/*
232235
* We have to create the databases first so we can install support
@@ -261,7 +264,9 @@ create_new_objects(void)
261264
{
262265
DbInfo *new_db = &new_cluster.dbarr.dbs[dbnum];
263266

264-
install_db_support_functions(new_db->db_name);
267+
/* skip db we already installed */
268+
if (strcmp(new_db->db_name, os_info.user) != 0)
269+
install_support_functions_in_db(new_db->db_name);
265270
}
266271
check_ok();
267272

contrib/pg_upgrade/pg_upgrade.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void check_hard_link(void);
321321

322322
/* function.c */
323323

324-
void install_db_support_functions(const char *db_name);
324+
void install_support_functions_in_db(const char *db_name);
325325
void uninstall_support_functions(void);
326326
void get_loadable_libraries(void);
327327
void check_loadable_libraries(void);

0 commit comments

Comments
 (0)