Actual row order in UPDATE and SELECT FOR UPDATE

Поиск
Список
Период
Сортировка
От Nikolai Zhubr
Тема Actual row order in UPDATE and SELECT FOR UPDATE
Дата
Msg-id 56C24E90.1030806@yandex.ru
обсуждение исходный текст
Ответы Re: Actual row order in UPDATE and SELECT FOR UPDATE  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Actual row order in UPDATE and SELECT FOR UPDATE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Actual row order in UPDATE and SELECT FOR UPDATE  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Список pgsql-general
Hello all,

I can't find any clear description of how to reliably figure and/or
enforce specific row (locking) order within UPDATE and SELECT FOR UPDATE
statements dealing with multiple rows.
I'd like to get rid of some deadlocks (caused by share locks). While the
manual explains locks and deadlocks themselves pretty fine (in e.g.
http://www.postgresql.org/docs/9.5/static/explicit-locking.html
) it somehow avoids discussing multi-row updates there. On the other
hand, the UPDATE section of the manual somehow avoids discussing actual
update order and respective locking too.
So is it defined anywhere explicitely? Or do I rather have to convert
all multi-row UPDATE statements into single-row updates and then wrap
them into e.g. plpgsql loops? That would look quite strange...
Any hints?


Thank you,
Nikolai


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

Предыдущее
От: Chris Mair
Дата:
Сообщение: Re: Trouble installing PostGIS on Amazon Linux server
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Actual row order in UPDATE and SELECT FOR UPDATE