X-Original-To: pgsql-sql@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 5028192566C for ; Mon, 26 May 2003 12:55:44 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 30789-05 for ; Mon, 26 May 2003 12:55:43 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by developer.postgresql.org (Postfix) with ESMTP id 7ADF0925885 for ; Mon, 26 May 2003 12:55:43 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h4QGtgU6002307; Mon, 26 May 2003 12:55:42 -0400 (EDT) To: michael.mattox@verideon.com Cc: pgsql-sql@postgresql.org Subject: Re: How to delete multiple rows from multiple joined tables In-reply-to: References: Comments: In-reply-to "Michael Mattox" message dated "Mon, 26 May 2003 15:48:16 +0200" Date: Mon, 26 May 2003 12:55:42 -0400 Message-ID: <2306.1053968142@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/498 X-Sequence-Number: 13663 "Michael Mattox" writes: > I want to delete all rows in table C & B that correspond to a row in Table > A. Depending on how automatic you want that to be, perhaps foreign keys would do what you want? You could set up B's and C's links to A as "on delete cascade" foreign keys, and then a deletion from A would clean them up too. regards, tom lane