Re: Deadlock. Referential Integrity checks select for update?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Grant McLean <grant(at)catalyst(dot)net(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Deadlock. Referential Integrity checks select for update?
Date: 2004-06-25 05:18:25
Message-ID: 2301.1088140705@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Grant McLean <grant(at)catalyst(dot)net(dot)nz> writes:
> I don't understand why these two queries include "FOR UPDATE".

The point is to lock the referenced rows so they cannot be deleted
before the referencing transaction commits. FOR UPDATE is an overly
strong lock, but we do not presently have any weaker lock that will
serve. You can find lots more about this issue in the archives...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Achilleus Mantzios 2004-06-25 06:08:13 tsearch2,pgsql 7.4.[1|2], pg_dump problem
Previous Message Tom Lane 2004-06-25 04:53:43 Re: Running two postmasters on one host: could not create semaphores