Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 660a081

Browse files
committed
Fix handling of extension membership when filling in a shell operator.
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.
1 parent 5473f28 commit 660a081

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/catalog/pg_operator.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,11 @@ makeOperatorDependencies(HeapTuple tuple)
774774
myself.objectId = HeapTupleGetOid(tuple);
775775
myself.objectSubId = 0;
776776

777-
/* In case we are updating a shell, delete any existing entries */
778-
deleteDependencyRecordsFor(myself.classId, myself.objectId, false);
777+
/*
778+
* In case we are updating a shell, delete any existing entries, except
779+
* for extension membership which should remain the same.
780+
*/
781+
deleteDependencyRecordsFor(myself.classId, myself.objectId, true);
779782
deleteSharedDependencyRecordsFor(myself.classId, myself.objectId, 0);
780783

781784
/* Dependency on namespace */

0 commit comments

Comments
 (0)