diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-23 16:59:49 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-23 16:59:49 -0400 |
commit | eb15f26d577a11319b9429fb84f752a0135918db (patch) | |
tree | 16f778f011e70136f8c8ec039daab0d2b48619b7 /src/backend/commands/proclang.c | |
parent | 16a6a70ea37be76b7c3757503defbbd05d2acdf1 (diff) | |
download | postgresql-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/proclang.c')
-rw-r--r-- | src/backend/commands/proclang.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index b36f31ee6d5..98770c5a61a 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -388,8 +388,7 @@ create_proc_lang(const char *languageName, bool replace, * Create dependencies for the new language. If we are updating an * existing language, first delete any existing pg_depend entries. * (However, since we are not changing ownership or permissions, the - * shared dependencies do *not* need to change, and we leave them alone. - * We also don't change any pre-existing extension-membership dependency.) + * shared dependencies do *not* need to change, and we leave them alone.) */ myself.classId = LanguageRelationId; myself.objectId = HeapTupleGetOid(tup); @@ -404,8 +403,7 @@ create_proc_lang(const char *languageName, bool replace, languageOwner); /* dependency on extension */ - if (!is_update) - recordDependencyOnCurrentExtension(&myself); + recordDependencyOnCurrentExtension(&myself, is_update); /* dependency on the PL handler function */ referenced.classId = ProcedureRelationId; |