Strange locking problem

Поиск
Список
Период
Сортировка
От Moshe Jacobson
Тема Strange locking problem
Дата
Msg-id CAJ4CxLnGpEOd+sNg8TjaLPGxr6dCb-sR2j4MyAB_cBFnavp5Hw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Strange locking problem  (Moshe Jacobson <moshe@neadwerx.com>)
Список pgsql-general
We have a long-running stored proc that duplicates a particular row in table called tb_location_map and also duplicates all related rows in several other tables.

The new records created contain foreign keys to our user data table, tb_entity. However there is no other reference to tb_entity in the cloning function.

We are seeing in SOME cases, but not all, that during the execution of this function, that the corresponding row in tb_entity is locked with a ROW SHARE lock (according to tb_locks, searching by the user's PID and tb_entity's relation ID), which is causing updates to the user's data to block while waiting for the map clone to finish.

What could be causing this ROW SHARE lock to be in place for some cloning operations and not others? Perhaps there is a way to see which specific statement is causing the lock to occur, but I'm not sure how to look this up. Any help would be appreciated.

Thanks!

--
Moshe Jacobson
Nead Werx, Inc. | Manager of Systems Engineering
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe@neadwerx.com | 
www.neadwerx.com

"Quality is not an act, it is a habit." -- Aristotle

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

Предыдущее
От: Richard Onorato
Дата:
Сообщение: Re: Table Partitioning
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_upgrade -u