*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.22 2008/01/01 19:45:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.23 2008/01/23 15:36:38 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
deleteobjs = new_object_addresses();
- sdepRel = heap_open(SharedDependRelationId, AccessExclusiveLock);
+ /*
+ * We don't need this strong a lock here, but we'll call routines that
+ * acquire RowExclusiveLock. Better get that right now to avoid potential
+ * deadlock failures.
+ */
+ sdepRel = heap_open(SharedDependRelationId, RowExclusiveLock);
/*
* For each role, find the dependent objects and drop them using the
/* the dependency mechanism does the actual work */
performMultipleDeletions(deleteobjs, behavior);
- heap_close(sdepRel, AccessExclusiveLock);
+ heap_close(sdepRel, RowExclusiveLock);
free_object_addresses(deleteobjs);
}
Relation sdepRel;
ListCell *cell;
- sdepRel = heap_open(SharedDependRelationId, AccessShareLock);
+ /*
+ * We don't need this strong a lock here, but we'll call routines that
+ * acquire RowExclusiveLock. Better get that right now to avoid potential
+ * deadlock problems.
+ */
+ sdepRel = heap_open(SharedDependRelationId, RowExclusiveLock);
foreach(cell, roleids)
{
systable_endscan(scan);
}
- heap_close(sdepRel, AccessShareLock);
+ heap_close(sdepRel, RowExclusiveLock);
}