Re: How to delete multiple rows from multiple joined tables - Mailing list pgsql-sql

From Tom Lane
Subject Re: How to delete multiple rows from multiple joined tables
Date
Msg-id 2306.1053968142@sss.pgh.pa.us
Whole thread Raw
In response to How to delete multiple rows from multiple joined tables  ("Michael Mattox" <michael.mattox@verideon.com>)
List pgsql-sql
"Michael Mattox" <michael.mattox@verideon.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


pgsql-sql by date:

Previous
From: Peter Childs
Date:
Subject: Re: Many-to-Many relation
Next
From: Tom Lane
Date:
Subject: Re: timestamp field - select error