Re: SIREAD lock versus ACCESS EXCLUSIVE lock

Поиск
Список
Период
Сортировка
Искать
От
Kevin Grittner
Тема
Re: SIREAD lock versus ACCESS EXCLUSIVE lock
Дата
Msg-id
4DEDF5DA020000250003E265@gw.wicourts.gov
Ответ на
Список
Дерево обсуждения
Re: SIREAD lock versus ACCESS EXCLUSIVE lock "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Tom Lane  wrote:
> If you don't believe that a catcache lookup will ever fail, I will
> contract to break the patch.
As you probably know by now by reaching the end of the thread, this
code is going away based on Heikki's arguments; but for my
understanding, so that I don't make a bad assumption in this area
again, what could cause the following function to throw an exception
if the current process is holding an exclusive lock on the relation
passed in to it?  (I could be a heap or an index relation.)  It
seemed safe to me, and I can't spot the risk on a scan of the called
functions.  What am I missing?
static Oid
IfIndexGetRelation(Oid indexId)
{   HeapTuple tuple;   Form_pg_index index;   Oid result;
   tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexId));   if (!HeapTupleIsValid(tuple))       return InvalidOid;
   index = (Form_pg_index) GETSTRUCT(tuple);   Assert(index->indexrelid == indexId);
   result = index->indrelid;   ReleaseSysCache(tuple);   return result;
}
Thanks for any clues,
-Kevin

В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Merlin Moncure
Дата:
Сообщение: Re: Range Types and extensions
FAQ