1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Fix pg_upgrade of large object permissions by preserving pg_auth.oid,

which is stored in pg_largeobject_metadata.

No backpatch to 9.0 because you can't migrate from 9.0 to 9.0 with the
same catversion (because of tablespace conflict), and a pre-9.0
migration to 9.0 has not large object permissions to migrate.
This commit is contained in:
Bruce Momjian
2011-01-07 21:59:29 -05:00
parent 2896c87ce4
commit d8d3d2a4f3
8 changed files with 80 additions and 31 deletions

View File

@ -224,11 +224,15 @@ prepare_new_databases(void)
set_frozenxids();
/*
* We have to create the databases first so we can create the toast table
* placeholder relfiles.
*/
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);
/*
* We have to create the databases first so we can install support
* functions in all the other databases.
*/
exec_prog(true,
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
/* --no-psqlrc prevents AUTOCOMMIT=off */
@ -247,10 +251,20 @@ prepare_new_databases(void)
static void
create_new_objects(void)
{
int dbnum;
/* -- NEW -- */
start_postmaster(&new_cluster, false);
install_support_functions();
prep_status("Adding support functions to new cluster");
for (dbnum = 0; dbnum < new_cluster.dbarr.ndbs; dbnum++)
{
DbInfo *new_db = &new_cluster.dbarr.dbs[dbnum];
install_db_support_functions(new_db->db_name);
}
check_ok();
prep_status("Restoring database schema to new cluster");
exec_prog(true,