On Sat, Oct 14, 2006 at 08:20:10PM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly