diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-23 16:59:39 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-23 16:59:39 -0400 |
commit | 988cccc620dd8c16d77f88ede167b22056176324 (patch) | |
tree | dfbe1be00080bf91976341ce55a5624c2403b796 /src/backend/commands/foreigncmds.c | |
parent | 6f1be5a67a758499beab0082b6e63b3040913268 (diff) | |
download | postgresql-988cccc620dd8c16d77f88ede167b22056176324.tar.gz postgresql-988cccc620dd8c16d77f88ede167b22056176324.zip |
Rethink behavior of CREATE OR REPLACE during CREATE EXTENSION.
The original implementation simply did nothing when replacing an existing
object during CREATE EXTENSION. The folly of this was exposed by a report
from Marc Munro: if the existing object belongs to another extension, we
are left in an inconsistent state. We should insist that the object does
not belong to another extension, and then add it to the current extension
if not already a member.
Diffstat (limited to 'src/backend/commands/foreigncmds.c')
-rw-r--r-- | src/backend/commands/foreigncmds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c index 643ba91bfe1..d16932ba6a0 100644 --- a/src/backend/commands/foreigncmds.c +++ b/src/backend/commands/foreigncmds.c @@ -515,7 +515,7 @@ CreateForeignDataWrapper(CreateFdwStmt *stmt) recordDependencyOnOwner(ForeignDataWrapperRelationId, fdwId, ownerId); /* dependency on extension */ - recordDependencyOnCurrentExtension(&myself); + recordDependencyOnCurrentExtension(&myself, false); /* Post creation hook for new foreign data wrapper */ InvokeObjectAccessHook(OAT_POST_CREATE, @@ -857,7 +857,7 @@ CreateForeignServer(CreateForeignServerStmt *stmt) recordDependencyOnOwner(ForeignServerRelationId, srvId, ownerId); /* dependency on extension */ - recordDependencyOnCurrentExtension(&myself); + recordDependencyOnCurrentExtension(&myself, false); /* Post creation hook for new foreign server */ InvokeObjectAccessHook(OAT_POST_CREATE, ForeignServerRelationId, srvId, 0); @@ -1137,7 +1137,7 @@ CreateUserMapping(CreateUserMappingStmt *stmt) } /* dependency on extension */ - recordDependencyOnCurrentExtension(&myself); + recordDependencyOnCurrentExtension(&myself, false); /* Post creation hook for new user mapping */ InvokeObjectAccessHook(OAT_POST_CREATE, UserMappingRelationId, umId, 0); |