aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tsearchcmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-07-23 16:59:49 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-07-23 16:59:49 -0400
commiteb15f26d577a11319b9429fb84f752a0135918db (patch)
tree16f778f011e70136f8c8ec039daab0d2b48619b7 /src/backend/commands/tsearchcmds.c
parent16a6a70ea37be76b7c3757503defbbd05d2acdf1 (diff)
downloadpostgresql-eb15f26d577a11319b9429fb84f752a0135918db.tar.gz
postgresql-eb15f26d577a11319b9429fb84f752a0135918db.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/tsearchcmds.c')
-rw-r--r--src/backend/commands/tsearchcmds.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/commands/tsearchcmds.c b/src/backend/commands/tsearchcmds.c
index 3355eaafda2..deac1062ef9 100644
--- a/src/backend/commands/tsearchcmds.c
+++ b/src/backend/commands/tsearchcmds.c
@@ -142,7 +142,7 @@ makeParserDependencies(HeapTuple tuple)
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
/* dependency on extension */
- recordDependencyOnCurrentExtension(&myself);
+ recordDependencyOnCurrentExtension(&myself, false);
/* dependencies on functions */
referenced.classId = ProcedureRelationId;
@@ -479,7 +479,7 @@ makeDictionaryDependencies(HeapTuple tuple)
recordDependencyOnOwner(myself.classId, myself.objectId, dict->dictowner);
/* dependency on extension */
- recordDependencyOnCurrentExtension(&myself);
+ recordDependencyOnCurrentExtension(&myself, false);
/* dependency on template */
referenced.classId = TSTemplateRelationId;
@@ -1069,7 +1069,7 @@ makeTSTemplateDependencies(HeapTuple tuple)
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
/* dependency on extension */
- recordDependencyOnCurrentExtension(&myself);
+ recordDependencyOnCurrentExtension(&myself, false);
/* dependencies on functions */
referenced.classId = ProcedureRelationId;
@@ -1417,8 +1417,7 @@ makeConfigurationDependencies(HeapTuple tuple, bool removeOld,
recordDependencyOnOwner(myself.classId, myself.objectId, cfg->cfgowner);
/* dependency on extension */
- if (!removeOld)
- recordDependencyOnCurrentExtension(&myself);
+ recordDependencyOnCurrentExtension(&myself, removeOld);
/* dependency on parser */
referenced.classId = TSParserRelationId;