Re: Removing Rows in Foreign Keys - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: Removing Rows in Foreign Keys
Date
Msg-id 20050404074750.GB14264@winnie.fuhr.org
Whole thread Raw
In response to Removing Rows in Foreign Keys  (brew@theMode.com)
Responses Re: Removing Rows in Foreign Keys
List pgsql-novice
On Mon, Apr 04, 2005 at 02:56:56AM -0400, brew@theMode.com wrote:
>
> Is there a SQL command that removes both a row in a table and the rows in
> other tables that reference it or do I have to do it manually?

If you define the foreign key constraints as ON DELETE CASCADE,
then referencing rows will be automatically deleted when you DELETE
the referenced row.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-novice by date:

Previous
From: brew@theMode.com
Date:
Subject: Removing Rows in Foreign Keys
Next
From: brew@theMode.com
Date:
Subject: Re: Removing Rows in Foreign Keys