DELETE trigger, direct or indirect?

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема DELETE trigger, direct or indirect?
Дата
Msg-id CAFCRh-_aJjgHvjbE4OvNHMAWygdJAC026_rgGYj1kfTmB-EvJA@mail.gmail.com
обсуждение исходный текст
Ответы Re: DELETE trigger, direct or indirect?  (Erik Wienhold <ewie@ewie.name>)
Re: DELETE trigger, direct or indirect?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
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).

To achieve this weird requirement, I'd like to know if it is possible in an ON DELETE trigger to know whether the deletion is coming from a direct-DELETE in the "child table", or whether the deletion is coming from the "parent table" CASCADEd to the child table.

Thanks, --DD

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

Предыдущее
От: Rama Krishnan
Дата:
Сообщение: Vacuum full issue
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Automatic aggressive vacuum on almost frozen table takes too long