Delete Cascade - Mailing list pgsql-general

From Marcelo Pereira
Subject Delete Cascade
Date
Msg-id 00a201c0ab06$20031400$0b01a8c0@hmmg
Whole thread Raw
Responses Re: Delete Cascade  (Karel Zak <zakkr@zf.jcu.cz>)
Re: Delete Cascade  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Hi,
 
I am in trouble deleting rows in cascade.
 
I have a scheme like this:
 
create table author (author_cod integer primary key, author_name char(20));
create table book (book_cod integer primary key, book_autor integer references author(author_cod), book_title char(30));
 
I would like to delete a 'author' in the author table and also all your books in the book table.
 
When I run
 
delete from author where author_cod = <number>
 
I dont get the row deleted if there is a row referenced by in the book table.
How can I delete my rows in cascade ???
 
Thanks in advance,
 
Marcelo Pereira
Computer Programmer

pgsql-general by date:

Previous
From: martin.chantler@convergys.com
Date:
Subject: Re: Re: Anyone can create tables!
Next
From: Tom Lane
Date:
Subject: Re: Poor Delete performance