Received: from s2.enthdimension.com.au ([203.36.78.178]) by hub.org (8.10.1/8.10.1) with ESMTP id e866MtB02517 for ; Wed, 6 Sep 2000 02:22:56 -0400 (EDT) Received: (from root@localhost) by s2.enthdimension.com.au (8.9.3/8.8.7) id RAA04479 for pgsql-sql@postgresql.org; Wed, 6 Sep 2000 17:21:26 GMT Date: Wed, 6 Sep 2000 17:21:26 +0000 From: Craig May To: pgsql-sql@postgresql.org Subject: Cascading Deletes Message-ID: <20000906172126.A4216@s2.enthdimension.com.au> Reply-To: craig.may@s2.enthdimension.com.au Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: x-unknown X-Mailer: Balsa 0.8.0 X-Archive-Number: 200009/28 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