From d8d3d2a4f37f6df5d0118b7f5211978cca22091a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 7 Jan 2011 21:59:29 -0500 Subject: 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. --- src/backend/commands/user.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/backend/commands/user.c') diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index be049cb994..63f22d8adc 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -35,6 +35,9 @@ #include "utils/syscache.h" #include "utils/tqual.h" +/* Potentially set by contrib/pg_upgrade_support functions */ +Oid binary_upgrade_next_pg_authid_oid = InvalidOid; + /* GUC parameter */ extern bool Password_encryption; @@ -393,6 +396,16 @@ CreateRole(CreateRoleStmt *stmt) tuple = heap_form_tuple(pg_authid_dsc, new_record, new_record_nulls); + /* + * pg_largeobject_metadata contains pg_authid.oid's, so we + * use the binary-upgrade override, if specified. + */ + if (OidIsValid(binary_upgrade_next_pg_authid_oid)) + { + HeapTupleSetOid(tuple, binary_upgrade_next_pg_authid_oid); + binary_upgrade_next_pg_authid_oid = InvalidOid; + } + /* * Insert new record in the pg_authid table */ -- cgit v1.2.1