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

From brew@theMode.com
Subject Re: Removing Rows in Foreign Keys
Date
Msg-id Pine.BSF.4.58.0504040423000.86885@themode.com
Whole thread Raw
In response to Re: Removing Rows in Foreign Keys  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice
Michael.....

> > 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.

Ah Ha, thanks muchly!!!  That's just what I was looking for.

brew

 ==========================================================================
                  Strange Brew   (brew@theMode.com)
  Check out my Stock Option Covered Call website  http://www.callpix.com
     and my Musician's Online Database Exchange http://www.TheMode.com
 ==========================================================================


pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Removing Rows in Foreign Keys
Next
From: John DeSoi
Date:
Subject: Re: Database Encoding