Index: src/backend/commands/async.c =================================================================== RCS file: /usr/local/cvsroot/pgsql-server/src/backend/commands/async.c,v retrieving revision 1.99 diff -2 -c -r1.99 async.c *** src/backend/commands/async.c 15 Sep 2003 00:26:31 -0000 1.99 --- src/backend/commands/async.c 16 Sep 2003 00:16:27 -0000 *************** *** 317,321 **** heap_endscan(scan); ! heap_close(lRel, AccessExclusiveLock); /* --- 317,321 ---- heap_endscan(scan); ! heap_close(lRel, NoLock); /* *************** *** 869,878 **** } ! /* Does pendingNotifies include the given relname? */ static bool AsyncExistsPendingNotify(const char *relname) { ! List *p; foreach(p, pendingNotifies) { --- 869,903 ---- } ! /* Does pendingNotifies and pg_listen include the given relname? */ static bool AsyncExistsPendingNotify(const char *relname) { ! List *p; ! Relation lRel; ! bool found = false; ! HeapScanDesc scan; ! HeapTuple tuple; ! ! lRel = heap_openr(ListenerRelationName, AccessExclusiveLock); ! ! scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL); ! while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL) ! { ! Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple); ! ! if(strncmp(NameStr(listener->relname), relname, NAMEDATALEN) == 0) ! { ! /* Found the matching tuple */ ! found = true; ! break; ! } ! } ! ! heap_endscan(scan); ! ! heap_close(lRel, AccessExclusiveLock); + if(!found) + return(false); foreach(p, pendingNotifies) {