On Mon, Apr 04, 2005 at 02:56:56 -0400,
brew@theMode.com wrote:
>
> Well, I confess. Although I've several databases running on postgreSQL
> I've never done more than just store data. (no constaints, no triggers, no
> functions, not even any transactions) I'm setting up a new schema for a
> new database and am learning about using foreign keys.
>
> 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?
>
> Sort of like 'DELETE CASCADE....." which I tried, to no avail. Perusing
> the manual didn't reveal anything....
If you use foreign keys that are set to on DELETE CASCADE then deleting
a referenced row will also delete all of the rows that reference it.