aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-22 10:55:47 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-22 10:55:47 -0400
commit660a081c3f6892dae353136fa0883cd3c69813d4 (patch)
tree2742b5cbab1b5e3776d72a38187f715a09dffb9e /src
parent5473f283f501ff9f5e38e89d3a2e89f738a7e76f (diff)
downloadpostgresql-660a081c3f6892dae353136fa0883cd3c69813d4.tar.gz
postgresql-660a081c3f6892dae353136fa0883cd3c69813d4.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/pg_operator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c
index 772e5d438d1..14404646b1f 100644
--- 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 */