Re: When to use cascading deletes? - Mailing list pgsql-general

From Leif B. Kristensen
Subject Re: When to use cascading deletes?
Date
Msg-id 200906120031.12868.leif@solumslekt.org
Whole thread Raw
In response to When to use cascading deletes?  (David <wizzardx@gmail.com>)
List 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 by date:

Previous
From: Greg Smith
Date:
Subject: Re: listing relations
Next
From: "Leif B. Kristensen"
Date:
Subject: Re: search for partial dates