Re: [GENERAL] deleting referenced data

2003-08-28 Thread Andreas Fromm
Bruno Wolff III wrote: On Wed, Aug 27, 2003 at 00:09:34 +0200, Andreas Fromm <[EMAIL PROTECTED]> wrote: Bruno Wolff III wrote: On Tue, Aug 26, 2003 at 18:34:04 +0100, Richard Huxton <[EMAIL PROTECTED]> wrote: I don't think that is what he wants. He seems to want to go in the other dire

Re: [GENERAL] deleting referenced data

2003-08-26 Thread Richard Huxton
On Tuesday 26 August 2003 18:55, Bruno Wolff III wrote: > On Tue, Aug 26, 2003 at 18:34:04 +0100, > > Richard Huxton <[EMAIL PROTECTED]> wrote: > > On Tuesday 26 August 2003 15:06, Andreas Fromm wrote: > > > When I delete a record of the table realtions I also want to delete the > > > record on t

Re: [GENERAL] deleting referenced data

2003-08-26 Thread Bruno Wolff III
On Tue, Aug 26, 2003 at 18:34:04 +0100, Richard Huxton <[EMAIL PROTECTED]> wrote: > On Tuesday 26 August 2003 15:06, Andreas Fromm wrote: > > > > When I delete a record of the table realtions I also want to delete the > > record on the data-tables if there is no other record referencing them. > >

Re: [GENERAL] deleting referenced data

2003-08-26 Thread Richard Huxton
On Tuesday 26 August 2003 15:06, Andreas Fromm wrote: > > When I delete a record of the table realtions I also want to delete the > record on the data-tables if there is no other record referencing them. > How can I do this? You want to add "ON DELETE CASCADE" to the REFERENCES... clause. See the

[GENERAL] deleting referenced data

2003-08-26 Thread Andreas Fromm
Hi, I have The following situation: CREATE TABLE data1 ( id SERIAL PRIMARY KEY, data INTEGER ); CREATE TABLE data2 ( id SERIAL PRIMARY KEY, data INTEGER ); CREATE TABLE data3 ( id SERIAL PRIMARY KEY, data INTEGER ); CREATE TABLE relations ( id SERIAL PRIMARY KEY, data1 INT