Re: When to use cascading deletes?

From: Russ Brown <pickscrape(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: When to use cascading deletes?
Date: 2009-06-11 20:10:34
Message-ID: 4A3164BA.2090606@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/11/2009 11:33 AM, Eric Schwarzenbach wrote:
> My rule of thumb for when to use to not use cascading deletes is this:
>
> If the what the record represents can essentially be thought of a "part
> of" what the record that it references represents, I use cascading
> deletes. If what the record represents has an independent existence,
> that it, it does not necessarily have the same life cycle, I prohibit
> cascading. (This is more or less the distinction between composition and
> aggregation in UML terms, if I remember correctly.)
>
> This amounts to the same advice others have already given, but in other
> terms, and may be helpful if you conceive of your data this way.
>
> Eric

"part of" is exactly the term that I was thinking of as well.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-06-11 20:14:14 Re: listing relations
Previous Message Brandon Metcalf 2009-06-11 20:06:20 listing relations