Re: How to delete multiple rows from multiple joined tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: michael(dot)mattox(at)verideon(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to delete multiple rows from multiple joined tables
Date: 2003-05-26 16:55:42
Message-ID: 2306.1053968142@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Michael Mattox" <michael(dot)mattox(at)verideon(dot)com> 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-05-26 18:08:52 Re: timestamp field - select error
Previous Message Peter Childs 2003-05-26 13:55:36 Re: Many-to-Many relation