Re: Trigger violates foreign key constraint

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>, pgsql-hackers(at)postgresql(dot)org
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Trigger violates foreign key constraint
Date: 2023-12-22 07:59:21
Message-ID: 1e72f3dc-143a-4880-a664-a91da153ca5b@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I fully support this addition to the documentation. The legal
possibility of breaking data consistency must be documented at least.

Please, consider small suggestion to replace last sentence.

- This is not considered a bug, and it is the responsibility of the user
to write triggers so that such problems are avoided.
+ It is the trigger programmer's responsibility to avoid such scenarios.

To be consistent with the sentence about recursive trigger calls: [1]
"It is the trigger programmer's responsibility to avoid infinite
recursion in such scenarios."

Also I don't really like "This is not considered a bug" part, since it
looks like an excuse.

1. https://www.postgresql.org/docs/devel/trigger-definition.html

--
Pavel Luzanov
Postgres Professional: https://postgrespro.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ywgrit 2023-12-22 08:20:43 Re: planner chooses incremental but not the best one
Previous Message Xiaoran Wang 2023-12-22 07:34:00 Re: [PATCH]: Not to invaldiate CatalogSnapshot for local invalidation messages