cascade problems

From: Michael Zouroudis <mzouroudis(at)idealcorp(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: cascade problems
Date: 2002-09-19 17:22:04
Message-ID: 3D8A07BC.2030203@idealcorp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

for those who can help,

on my database i have two tables, organization and transaction, listed here;
-------------------------------------
create table organization(
organ_person_id serial primary key,
asset_id int,
fname text,
lname text,
phone varchar(15),
email varchar(20),
constraint organization_asset_id_fk foreign key(asset_id) references
assets(asset_id));

create table transaction(
transaction_id serial primary key,
trans_date timestamp default current_timestamp,
return_date timestamp,
organ_person_id int,
constraint transaction_organ_person_id_fk foreign key(organ_person_id)
references organization(organ_person_id) on delete cascade );

---------------------------------

what i want is for a delete on transaction to make a delete on
organization where the organ_person_id s match up,with a query like;

*delete from transaction where organ_person_id = 15;*

but this is not happening. all it does is delete from transaction, and
doesn't touch organization. am i doing something wrong?

please help,

mike z

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-09-19 17:22:15 Re: killing process question
Previous Message Johnson, Shaunn 2002-09-19 17:16:42 Re: killing process question