Re: Read Lock For Foreign Key

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: Read Lock For Foreign Key
Дата
Msg-id 3D595AA7.4A4786A2@Yahoo.com
обсуждение исходный текст
Ответ на Read Lock For Foreign Key  (Jon Swinth <jswinth@atomicpc.com>)
Ответы Re: Read Lock For Foreign Key  (Jon Swinth <jswinth@atomicpc.com>)
Список pgsql-general
Jon Swinth wrote:
>
> How come having foreign keys take out a read lock on a parent row rather than
> a write lock is not on the todo list?  I had someone tell me that this is
> difficult because the SQL standard does not include syntax for read lock.
> Does the fact that it will be difficult mean that it isn't needed?

The problem is that the row has to be locked against concurrent updates
until the end of the transaction. As of now, the only way to do that
under PostgreSQLs MVCC is to grab a lock FOR UPDATE, which is exclusive.

The fact that it is difficult does not mean it isn't needed. It is
simply the reason why it hasn't been done yet.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #

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

Предыдущее
От: Jon Swinth
Дата:
Сообщение: Read Lock For Foreign Key
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Read Lock For Foreign Key