Re: Trigger violates foreign key constraint

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: Trigger violates foreign key constraint
Date: 2024-04-19 09:16:50
Message-ID: CAJ7c6TMvi+1qh1Z3fz=FSifh0WaPRF1qtxJkAOCSThC7JMwagg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> Perhaps we should leave the system triggers out of the discussion
> entirely? More or less like:
>
> If a foreign key constraint specifies referential actions (that
> is, cascading updates or deletes), those actions are performed via
> ordinary SQL update or delete commands on the referencing table.
> In particular, any triggers that exist on the referencing table
> will be fired for those changes. If such a trigger modifies or
> blocks the effect of one of these commands, the end result could
> be to break referential integrity. It is the trigger programmer's
> responsibility to avoid that.

That's perfect!

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2024-04-19 09:47:43 Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS
Previous Message Dean Rasheed 2024-04-19 09:02:42 Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS