Re: Trigger violates foreign key constraint

Поиск
Список
Период
Сортировка
От Pavel Luzanov
Тема Re: Trigger violates foreign key constraint
Дата
Msg-id e6a7c792-4cc4-45da-8a6e-6f6d74a3897d@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Trigger violates foreign key constraint  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-hackers
On 22.12.2023 14:39, Laurenz Albe wrote:
Yes, that is better - shorter and avoids passive mode.  Changed.

Thanks.

Also I don't really like "This is not considered a bug" part, since it 
looks like an excuse.
In a way, it is an excuse, so why not be honest about it.

I still think that the "this is not a bug" style is not suitable for documentation.
But I checked the documentation and found 3-4 more such places.
Therefore, it's ok from me, especially since it really looks like a bug.
The example you provided in your other message (cascading triggers
fail if the table ovner has revoked the required permissions from
herself) is not really about breaking foreign keys.  You hit a
surprising error, but referential integrity will be maintained.

Yes, referential integrity will be maintained. But perhaps
it is worth adding a section to the documentation about system triggers
that are used to implement foreign keys. Now it is not mentioned anywhere,
but questions and problems arise from time to time.
Such a section named "System triggers" may be added as a separate chapter
to Part VII. Internals or as a subsection to Chapter 38.Triggers.

I thought about this after your recent excellent article [1],
which has an introduction to system triggers.

This does not negate the need for the patch being discussed.

Patch v3 is attached.

For me, it is ready for committer.

1. https://www.cybertec-postgresql.com/en/broken-foreign-keys-postgresql/
-- 
Pavel Luzanov
Postgres Professional: https://postgrespro.com

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Anton A. Melnikov"
Дата:
Сообщение: Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.
Следующее
От: Ayush Vatsa
Дата:
Сообщение: Proposal to include --exclude-extension Flag in pg_dump