Re: Trigger violates foreign key constraint

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Trigger violates foreign key constraint
Дата
Msg-id 92d375c65b38d69af7fb05062ebb2ea18e09f14b.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: Trigger violates foreign key constraint  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Ответы Re: Trigger violates foreign key constraint  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Re: Trigger violates foreign key constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, 2023-12-22 at 10:59 +0300, Pavel Luzanov wrote:
> 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."

Yes, that is better - shorter and avoids passive mode.  Changed.

> 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.

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.

Patch v3 is attached.

Yours,
Laurenz Albe

Вложения

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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: Built-in CTYPE provider
Следующее
От: Junwang Zhao
Дата:
Сообщение: Re: Transaction timeout