PL/pgsql locking policy

Поиск
Список
Период
Сортировка
От Richard Emberson
Тема PL/pgsql locking policy
Дата
Msg-id 3C9E529D.DA5E4C96@phc.net
обсуждение исходный текст
Ответы Re: PL/pgsql locking policy
Список pgsql-general
If you have a PL/pgsql procedure that first reads from a given table to
verify a condition and
then if the condition is true write to that same table ... and at the
same time you want other
processes to be able to simply read from the table, what is the best
locking policy within the procedure?

While ACCESS EXCLUSIVE MODE prevents others from reading.
allowing other to read means that two process might be concurrently
reading (verifying) within
the procedure, reach the same condition value, and then both attempt to
write data.

Is it better to simply have a helper table, a table created just for
this one procedure, the only mechanism
where writing to the table actually occurs, and use this helper table as
the locking mechanism.

Richard


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