Re: FK check implementation

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Nick Barnes <nickbarnes01(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: FK check implementation
Date: 2014-10-10 18:01:33
Message-ID: 54381EFD.5070602@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/10/2014 10:41 AM, Nick Barnes wrote:

>
> I understand why the FK insert needs to lock on the PK row. But why is
> the PK delete trying to lock the FK row? If it finds one, won't the
> delete fail anyway? If it doesn't find one, what is there to lock?
>

I would say this has to do with setting DEFERRABLE on a constraint.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message vibhor.kumar@enterprisedb.com 2014-10-10 18:03:54 Re: psql generate insert command based on select
Previous Message Adrian Klaver 2014-10-10 17:53:32 Re: psql generate insert command based on select