Re: Foreign key reference counting strategy?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Foreign key reference counting strategy?
Дата
Msg-id 20061015010725.GA21149@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Foreign key reference counting strategy?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Foreign key reference counting strategy?
Список pgsql-sql
On Sat, Oct 14, 2006 at 08:20:10PM -0400, Tom Lane wrote:
> Michael Fuhr <mike@fuhr.org> writes:
> > Unless the inserters got there first.  I just tested both ways; if
> > the insert acquires the lock first then the delete fails, but if the
> > delete acquires the lock first then the insert fails.
> 
> Well, if the inserters get a lock on the PK row before the DELETE does,
> then of course.  I was just disputing the assertion that doing IF EXISTS
> in an after trigger would add a new way for the DELETE to fail.

My intent wasn't to assert that IF EXISTS adds a new way for the
DELETE to fail.  I was just pointing out that the test "if no
referencing rows exist then delete the referenced row" isn't
foolproof, viz., the DELETE can fail even though IF EXISTS said
there were no referencing rows.

-- 
Michael Fuhr


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Foreign key reference counting strategy?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Foreign key reference counting strategy?