Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 50BA44760F6 for ; Fri, 13 Sep 2002 13:05:40 -0400 (EDT) Received: from gateway.idealcorp.com (66-192-27-146.gen.twtelecom.net [66.192.27.146]) by postgresql.org (Postfix) with ESMTP id 9A269475FC4 for ; Fri, 13 Sep 2002 13:05:39 -0400 (EDT) Received: from idealcorp.com (client07.office.ideal [192.168.1.17]) by gateway.idealcorp.com (8.12.3/8.12.3/Debian -4) with ESMTP id g8DH5dQ4007244 for ; Fri, 13 Sep 2002 13:05:39 -0400 Message-ID: <3D821AE3.9090008@idealcorp.com> Date: Fri, 13 Sep 2002 13:05:39 -0400 From: Michael Zouroudis User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: on delete cascade problems Content-Type: multipart/alternative; boundary="------------040706080304030900010704" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/174 X-Sequence-Number: 5713 --------------040706080304030900010704 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit to: anyone who can help: i am developing a db in pl/pgsql at work and i am having problems with one final part; the deleting of ref. int. rows. there are three tables, which i will list below as close as possible to what i remember (i'm at home and don't have my notes). create table goodbye ( goodbye_id serial primary key, whenn text, wheree text, how text, isbn int ); create table hello ( hello_id serial primary key, goodbye_id int, how text, isbn int, constraints hello_goodbye_id_fk foreign key references goodbye(goodbye_id) on delete cascade ); create table aidos ( adios_id serial primary key, cost money, title text ); create table goodbye_adios ( goodbye_id int, adios_id int, constraint goodbye_adios_goodbye_id_fk foreign key references goodbye(goodbye_id) on delete cascade, constraint goodbye_adios_adios_id_fk foreign key references adios(adios_id) on delete cascade ); like i said, this is as close as i can remember. the problem that occurs is that when i do a delete statement on the goodbye_adios table, it will automatically delete from the goodbye_adios table and the goodbye table, but not the record from the adios table. i searched all day and seemed to be doing what the docs told me to, but to no avail. it's been bothering me all night so if anybody knows how to work the cascade effect properly please email me back at either of these addresses; mazuru@prodigy.net mazuru@aol.com mzouroudis@idealcorp.com thanks in advance for the help, mike -- Mike Zouroudis Intern __________________________________________________ I.D.E.A.L. Technology Corporation - Orlando Office http://www.idealcorp.com - 407.999.9870 x14 --------------040706080304030900010704 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit to:  anyone who can help:

i am developing a db in pl/pgsql at work and i am having problems with one final part;  the deleting of ref. int. rows.  there are three tables, which i will list below as close as possible to what i remember (i'm at home and don't have my notes).

create table goodbye (
goodbye_id    serial     primary key,
whenn             text,
wheree             text,
how                   text,
isbn                    int
);

create table hello (
hello_id             serial        primary key,
goodbye_id           int,
how                      text,
isbn                        int,
constraints hello_goodbye_id_fk foreign key references goodbye(goodbye_id) on delete cascade
);

create table aidos (
adios_id         serial          primary key,
cost                money,
title                   text
);

create table goodbye_adios (
goodbye_id          int,
adios_id              int,
constraint goodbye_adios_goodbye_id_fk foreign key references goodbye(goodbye_id) on delete cascade,
constraint goodbye_adios_adios_id_fk foreign key references adios(adios_id) on delete cascade
);

like i said, this is as close as i can remember. 

the problem that occurs is that when i do a delete statement on the goodbye_adios table, it will automatically delete from the goodbye_adios table and the goodbye table, but not the record from the adios table.  i searched all day and seemed to be doing what the docs told me to, but to no avail.  it's been bothering me all night so if anybody knows how to work the cascade effect properly please email me back at either of these addresses;

mazuru@prodigy.net
mazuru@aol.com
mzouroudis@idealcorp.com

thanks  in advance for the help,

mike

-- 
Mike Zouroudis
Intern
__________________________________________________
I.D.E.A.L. Technology Corporation - Orlando Office
http://www.idealcorp.com - 407.999.9870 x14

--------------040706080304030900010704--