Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebaf648

Browse files
committed
In pg_upgrade, clarify use of install_db_support_functions().
1 parenta60b32b commitebaf648

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(constchar*db_name)
22+
install_support_functions_in_db(constchar*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 @@ voidcheck_hard_link(void);
321321

322322
/* function.c */
323323

324-
voidinstall_db_support_functions(constchar*db_name);
324+
voidinstall_support_functions_in_db(constchar*db_name);
325325
voiduninstall_support_functions(void);
326326
voidget_loadable_libraries(void);
327327
voidcheck_loadable_libraries(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp