Re: DELETE CASCADE

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: David Christensen <david(dot)christensen(at)crunchydata(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DELETE CASCADE
Date: 2021-06-09 07:21:45
Message-ID: 1f5bcf95-d24c-b8c8-542e-47ad10ff2ddf@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-06-09 07:23:47 Re: Duplicate history file?
Previous Message Peter Eisentraut 2021-06-09 07:17:52 Re: DELETE CASCADE