Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c471d2

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 38c9eb8 commit 9c471d2

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
@@ -776,8 +776,11 @@ makeOperatorDependencies(HeapTuple tuple)
776776
myself.objectId = HeapTupleGetOid(tuple);
777777
myself.objectSubId = 0;
778778

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

783786
/* Dependency on namespace */

0 commit comments

Comments
 (0)