Re: DELETE CASCADE - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: DELETE CASCADE
Date
Msg-id 1f5bcf95-d24c-b8c8-542e-47ad10ff2ddf@enterprisedb.com
Whole thread Raw
In response to Re: DELETE CASCADE  (David Christensen <david.christensen@crunchydata.com>)
Responses Re: DELETE CASCADE  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On 08.06.21 21:25, David Christensen wrote:
>     I sense more complicated concurrency and permission issues, however.
> 
> Assuming this happens in the same transaction, wouldn't this just work?  
> Or are you thinking there needs to be some sort of predicate lock to 
> prevent a concurrent add of the referencing record in the FK table?

It might work, I'm just saying it needs to be thought about carefully. 
If you have functionality like, delete this if there is no matching 
record over there, you need to have the permission to check that and 
need to make sure it stays that way.



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: DELETE CASCADE
Next
From: Fujii Masao
Date:
Subject: Re: Duplicate history file?