pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Zouroudis <mzouroudis@idealcorp.com>
To: pgsql-admin@postgresql.org
Subject: on delete cascade problems
Date: Fri, 13 Sep 2002 13:05:39 -0400
Message-ID: <3D821AE3.9090008@idealcorp.com> (raw)

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

Message-ID: <3D821AE3.9090008@idealcorp.com>
Permalink:  ../3D821AE3.9090008@idealcorp.com/
Also on:    postgresql.org/message-id/3D821AE3.9090008@idealcorp.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mzouroudis@idealcorp.com
  Subject: Re: on delete cascade problems
  In-Reply-To: <3D821AE3.9090008@idealcorp.com>
  References: <3D821AE3.9090008@idealcorp.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox