Re: Transactions and RowExclusive locks on foreign key tables

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Transactions and RowExclusive locks on foreign key tables
Дата
Msg-id 20030313100750.V68611-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Transactions and RowExclusive locks on foreign key tables  ("Donald Fraser" <demolish@cwgsy.net>)
Список pgsql-bugs
On Thu, 13 Mar 2003, Donald Fraser wrote:

> I have a question regarding transactions.

> When updating a row of a table PostgreSQL obtains a RowExclusive lock,
> which according to the docs means that no other transaction can obtain
> a RowExclusive lock on this row in the same table until the existing
> one is released. That seems fair enough when inserting, updating or
> deleting rows from a table.
>
> But why does PostgreSQL need a RowExclusive lock on the foreign key
> table when it is not going to update the row in the foreign key table?
> Surely it only needs a sharable lock that stops other transactions
> updating or deleting this row.

There isn't currently such a lock in PostgreSQL, the row exclusive lock
was what was available at the time.  This has been discussed on -general
and -hackers in the near past, you might want to look at the archives.

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

Предыдущее
От: "Donald Fraser"
Дата:
Сообщение: Transactions and RowExclusive locks on foreign key tables
Следующее
От: Oliver Elphick
Дата:
Сообщение: now() and date_trunc() apparently corrupting data