Re: When to use cascading deletes?

Поиск
Список
Период
Сортировка
От Leif B. Kristensen
Тема Re: When to use cascading deletes?
Дата
Msg-id 200906120031.12868.leif@solumslekt.org
обсуждение исходный текст
Ответ на When to use cascading deletes?  (David <wizzardx@gmail.com>)
Список pgsql-general
On Thursday 11. June 2009, David wrote:

>When is a good time to use cascading deletes?

As a real world example, I've got a data model that consists of three
major entities: Persons, Events, and Sources. The Events table is
linked to Persons through the junction table Participants, and to the
Sources through the junction table Citations. In both the Participants
and the Citations tables I have declared the foreign key events_fk as
ON DELETE CASCADE. That is because they don't carry extra information
that is usable outside the context of the Event to which they are
pointing. So, if I delete an Event, the Participants as well as the
Citations to that event are hosed. But the Persons and the Sources will
of course remain in the database.
--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/

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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: listing relations
Следующее
От: "Leif B. Kristensen"
Дата:
Сообщение: Re: search for partial dates