summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/pg_upgrade.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2011-01-07 21:59:29 -0500
committerBruce Momjian <bruce@momjian.us>2011-01-07 21:59:29 -0500
commitd8d3d2a4f37f6df5d0118b7f5211978cca22091a (patch)
tree11299c3a356d18091724b3506c6e2b8ae9965a5d /contrib/pg_upgrade/pg_upgrade.c
parent2896c87ce4dc789722296f010eaefd5cbb86ece3 (diff)
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.
Diffstat (limited to 'contrib/pg_upgrade/pg_upgrade.c')
-rw-r--r--contrib/pg_upgrade/pg_upgrade.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
index 3de47fc62ec..dd50eb85ccc 100644
--- a/contrib/pg_upgrade/pg_upgrade.c
+++ b/contrib/pg_upgrade/pg_upgrade.c
@@ -224,11 +224,15 @@ prepare_new_databases(void)
set_frozenxids();
+ 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 create the toast table
- * placeholder relfiles.
+ * We have to create the databases first so we can install support
+ * functions in all the other databases.
*/
- prep_status("Creating databases in the new cluster");
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,