git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5473f28)
Fix handling of extension membership when filling in a shell operator.
2011年8月22日 14:55:47 +0000 (10:55 -0400)
2011年8月22日 14:55:47 +0000 (10:55 -0400)
The previous coding would result in deleting and not re-creating the
extension membership pg_depend rows, since there was no
CommandCounterIncrement that would allow recordDependencyOnCurrentExtension
to see that the deletion had happened. Make it work like the shell type
case, ie, keep the existing entries (and then throw an error if they're for
the wrong extension).

Per bug #6172 from Hitoshi Harada. Investigation and fix by Dimitri
Fontaine.


diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c
index 772e5d438d170428d32c15dacd2a6fe102536271..14404646b1f34ff88828d9a90abbce399f42caad 100644 (file)
--- a/src/backend/catalog/pg_operator.c
+++ b/src/backend/catalog/pg_operator.c
@@ -774,8 +774,11 @@ makeOperatorDependencies(HeapTuple tuple)
myself.objectId = HeapTupleGetOid(tuple);
myself.objectSubId = 0;
- /* In case we are updating a shell, delete any existing entries */
- deleteDependencyRecordsFor(myself.classId, myself.objectId, false);
+ /*
+ * In case we are updating a shell, delete any existing entries, except
+ * for extension membership which should remain the same.
+ */
+ deleteDependencyRecordsFor(myself.classId, myself.objectId, true);
deleteSharedDependencyRecordsFor(myself.classId, myself.objectId, 0);
/* Dependency on namespace */
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /