delete on cascade - Mailing list pgsql-sql

From Luca Ferrari
Subject delete on cascade
Date
Msg-id 200610231049.16507.fluca1978@infinito.it
Whole thread Raw
Responses Re: delete on cascade  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Re: delete on cascade  (chester c young <chestercyoung@yahoo.com>)
Re: delete on cascade  (Richard Broersma Jr <rabroersma@yahoo.com>)
Re: delete on cascade  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Function to reset sequence.....  ("Doug Hyde" <doug.hyde@e-cocreate.com>)
List pgsql-sql
Hi all,
I guess this is an already asked question, but I didn't found an answer, so 
apologize me. Imagine I've got two tables:
skill(id,description)        // primary key => id
family(id,description)    // primary key => id
and I want to associate skills to families:
ass_sf(id_skill,id_family)    // appropriate foreign keys

Tables are already created and the database is running. Now I'd like to 
implement a delete cascade, thus when I delete a skill also its association 
with the family must be deleted. I gues I should have declared the skill 
table as follows:
CREATE TABLE skill
(id varchar(20) on delete cascade,description varchar(50),primary key(id)
);

right? The problem is: how can I alter the table to add the column constraint 
now, without redeclaring the table?
Thanks very much for helping me.
Luca


pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Crosstab question
Next
From: Achilleas Mantzios
Date:
Subject: Re: delete on cascade