Re: a SELECT FOR UPDATE question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: a SELECT FOR UPDATE question
Дата
Msg-id 3220.1107845144@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: a SELECT FOR UPDATE question  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: a SELECT FOR UPDATE question
Список pgsql-general
Michael Fuhr <mike@fuhr.org> writes:
> On Tue, Feb 08, 2005 at 12:58:34AM -0500, Tom Lane wrote:
>> I'm too tired to work out an example, but I think this probably doesn't
>> work in general: the xmax on the version of the row you can see might
>> not correspond to a live transaction, but that doesn't mean someone
>> else doesn't hold a lock on the latest committed version of the row.

> If you could point me in the right direction I'll try to work out
> an example where my suggestion fails.

I'm thinking about a multiple-update situation: your snapshot includes
row version A, which was superseded by version B, which was superseded
by version C.  By the time you are looking, the transaction that
committed version B is gone so the xmax you see (B's xact) isn't locked
anymore.  But the "frontmost" version of the row is still locked (by C
or some later heir) so if you tried to update you'd block.

Like I said, I'm pretty tired and I might be missing something...

            regards, tom lane

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

Предыдущее
От: Shaun Clements
Дата:
Сообщение: Re: Problem performing a restore of a data schema in Wi
Следующее
От: Teddy
Дата:
Сообщение: C++ Builder prob.