Re: a few questions (and doubts) about xid

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: a few questions (and doubts) about xid
Дата
Msg-id 26404.1185458659@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: a few questions (and doubts) about xid  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: a few questions (and doubts) about xid  (Luca Ferrari <fluca1978@infinito.it>)
Список pgsql-general
Alvaro Herrera <alvherre@commandprompt.com> writes:
> What's going on here is that we use Xmax not only for storing "this
> transaction deleted the row" but also for storing "this transaction
> locked the row".  So the row is not really deleted at all.  The
> IS_LOCKED bit tells you whether the row is locked or deleted when the
> Xmax is set.

> Of course, a locked row cannot be deleted.  When you want to delete a
> row that you have previously locked, you reset the IS_LOCKED bit.

Perhaps more accurately, a row that has been outdated (either replaced
by an updated version, or deleted) is also considered locked by the
Xmax transaction, until such time as that transaction commits or rolls
back.  Other xacts that might want to modify the row have to wait for
the Xmax xact before they can know whether it's OK to modify or not.

The IS_LOCKED bit serves as a means of locking the row without actually
modifying it (yet).  The locking semantics aren't really any different.

            regards, tom lane

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

Предыдущее
От: "James B. Byrne"
Дата:
Сообщение: Re: ssl connections to postgresql
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: ssl connections to postgresql