pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig May <craig.may@s2.enthdimension.com.au>
To: pgsql-sql@postgresql.org
Subject: Cascading Deletes
Date: Wed, 6 Sep 2000 17:21:26 +0000
Message-ID: <20000906172126.A4216@s2.enthdimension.com.au> (raw)

Hi,

I have a tables having this structure:

ID (int) | _ID (int) | Name (String)


_ID is the parent of ID.

I'm looking for the best method to perform a cascade delete.  For example, I
delete _ID, it in turn deletes ID, and should ID also be an entry within _ID, it
would continue through the chain.

For example:

0 0 Base
1 0 Sib1
2 0 Sib2
3 0 Sib3
4 1 Sib1_1
5 1 Sib1_2


Deleting Base would remove all the entries.  Deleting Sib1 would delete Sib1_1
and Sib1_2.
Can anyone help out here?

Regards,
Craig May

Enth Dimension
http://www.enthdimension.com.au




view thread (4+ messages)  latest in thread

Message-ID: <20000906172126.A4216@s2.enthdimension.com.au>
Permalink:  ../20000906172126.A4216@s2.enthdimension.com.au/
Also on:    postgresql.org/message-id/20000906172126.A4216@s2.enthdimension.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: craig.may@s2.enthdimension.com.au
  Subject: Re: Cascading Deletes
  In-Reply-To: <20000906172126.A4216@s2.enthdimension.com.au>
  References: <20000906172126.A4216@s2.enthdimension.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox