Re: Can pessimistic locking be emulated?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can pessimistic locking be emulated?
Дата
Msg-id 27562.1046376159@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Can pessimistic locking be emulated?  (Rod Taylor <rbt@rbt.ca>)
Ответы Re: Can pessimistic locking be emulated?
Список pgsql-hackers
Rod Taylor <rbt@rbt.ca> writes:
> Agreed -- but they're stored on the row themselves.  You might be able
> to write a function which executes dirty reads on the table and tells
> you if the row is locked or not, but it's not going to be simple.

Actually, I don't think you need a dirty read at all.  A locked row
can't be deleted as well (because there's only one xmax slot), so if you
can see it (ie, you think its xmin is committed) then you can in
principle find out whether it's locked or not.  We just don't expose the
info at the moment.  (You can see xmax at the user level, but you can't
easily tell if xmax is trying to delete the row or just lock it, because
you don't have access to the infomask bit that would tell you.)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: mlw
Дата:
Сообщение: Re: analyze after a database restore?
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: Can pessimistic locking be emulated?