From caddcb8f4b96ce48b612e7c987ecde654d624616 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 9 Feb 2011 19:17:33 -0500 Subject: Fix pg_upgrade to handle extensions. This follows my proposal of yesterday, namely that we try to recreate the previous state of the extension exactly, instead of allowing CREATE EXTENSION to run a SQL script that might create some entirely-incompatible on-disk state. In --binary-upgrade mode, pg_dump won't issue CREATE EXTENSION at all, but instead uses a kluge function provided by pg_upgrade_support to recreate the pg_extension row (and extension-level pg_depend entries) without creating any member objects. The member objects are then restored in the same way as if they weren't members, in particular using pg_upgrade's normal hacks to preserve OIDs that need to be preserved. Then, for each member object, ALTER EXTENSION ADD is issued to recreate the pg_depend entry that marks it as an extension member. In passing, fix breakage in pg_upgrade's enum-type support: somebody didn't fix it when the noise word VALUE got added to ALTER TYPE ADD. Also, rationalize parsetree representation of COMMENT ON DOMAIN and fix get_object_address() to allow OBJECT_DOMAIN. --- src/backend/commands/comment.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/backend/commands/comment.c') diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index bbb3f344093..faef256b1d8 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -105,6 +105,7 @@ CommentObject(CommentStmt *stmt) strVal(linitial(stmt->objname))); break; case OBJECT_TYPE: + case OBJECT_DOMAIN: if (!pg_type_ownercheck(address.objectId, GetUserId())) aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TYPE, format_type_be(address.objectId)); -- cgit v1.2.3