Re: Partitioning/inherited tables vs FKs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Partitioning/inherited tables vs FKs
Дата
Msg-id 5573.1273586630@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Partitioning/inherited tables vs FKs  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Список pgsql-hackers
Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi> writes:
> On 5/11/10 4:11 PM +0300, I wrote:
>> I took the "SELECT ... FOR SHARE" suggestion in a more general way,
>> suggesting the use of row-level locks.  T2 should be holding an
>> exclusive row-level lock (SELECT ... FOR UPDATE) when checking for
>> references.

> Hmm.  Right, that transaction wouldn't see the rows in a serializable 
> transaction so this doesn't solve the problem.

Yeah.  The hidden "magic" in the built-in FK code is not locking
(it does actually use SELECT FOR SHARE to lock rows).  Rather, it's
about doing tuple liveness checks using snapshots that aren't available
at the SQL level, particularly in serializable transactions.
        regards, tom lane


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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: List traffic
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: List traffic