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

Commit6238473

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 parent9e95c9a commit6238473

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
staticvoidsetup(char*argv0,boollive_check);
5151
staticvoidcleanup(void);
5252

53+
/* This is the database used by pg_dumpall to restore global tables */
54+
#defineGLOBAL_DUMP_DB"postgres"
55+
5356
ClusterInfoold_cluster,new_cluster;
5457
OSInfoos_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 thedatabase accessed by
230-
*GLOBALS_DUMP_FILE because it can preserve pg_authid.oid.
232+
*Install support functions in theglobal-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)

[8]ページ先頭

©2009-2025 Movatter.jp