postgres.git / summary / log / commit / refs

commit    9c471d24126280a5f90ee9d276a9df37480dfcde
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Mon Aug 22 14:55:47 2011 +0000
First released in: 9.2.0, 9.1.0

    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.


src/backend/catalog/pg_operator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c index 013707495d1..88410e5090b 100644 --- a/src/backend/catalog/pg_operator.c +++ b/src/backend/catalog/pg_operator.c @@ -776,8 +776,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 */ [parent: 38c9eb8fee29]