Re: DELETE trigger, direct or indirect?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: DELETE trigger, direct or indirect?
Дата
Msg-id CAKFQuwZ-f+ukUkai64mj_SFFSW_WC0nr+1SmzEkvauf+qASfhg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: DELETE trigger, direct or indirect?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: DELETE trigger, direct or indirect?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Thu, Feb 16, 2023 at 9:46 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 2/16/23 05:23, Dominique Devienne wrote:
> Hi. This is a bit unusual. We have a foreign key between two tables,
> with ON DELETE CASCADE, to preserve referential integrity. But we
> apparently also need to preserve the severed reference (by natural key,
> i.e. its name), to later on reconnect the two entities after-the-fact,
> should the parent row re-appear later on (in the same transaction or not
> it still unclear).

This is going to need a more detailed description of the relationship
between the two tables:

1) The actual FK relationship.

2) What "...preserve the severed reference (by natural key,  i.e. its
name)" means?

3) What information will be used to reconnect the child rows to the
parent rows?


Maybe the OP should be using ON DELETE SET NULL instead of CASCADE?

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: DELETE trigger, direct or indirect?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: DELETE trigger, direct or indirect?