Re: Trigger violates foreign key constraint

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: pgsql-hackers@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Laurenz Albe <laurenz.albe@cybertec.at>, Pavel Luzanov <p.luzanov@postgrespro.ru>, "David G. Johnston" <david.g.johnston@gmail.com>
Date: 2024-04-18T12:24:39Z
Lists: pgsql-hackers
Hi,

> Laurenz Albe <laurenz.albe@cybertec.at> writes:
> > Patch v3 is attached.
>
> I agree with documenting this hazard, but I think it'd be better
> to do so in the "Triggers" chapter.  There is no hazard unless
> you are writing user-defined triggers, which is surely far fewer
> people than use foreign keys.  So I suggest something like the
> attached.

I don't mind changing the chapter, but I prefer the wording chosen in
v3. The explanation in v4 is somewhat hard to follow IMO.

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Doc: document that triggers can break referential integrity.