Re: Deleting Problem

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Jamie Deppeler <jamie(at)doitonce(dot)net(dot)au>
Cc: General PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Deleting Problem
Date: 2006-10-31 00:09:30
Message-ID: 20061030160702.F41680@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, 31 Oct 2006, Jamie Deppeler wrote:

> Here is my problem
>
> I have a level structure which is 5 levels deep with 6 tables, for this
> example i will call it table1,table2,table3,table4,table5,table6
>
> (1)table1
> (2)table2
> (3)table3
> (4)table4
> (5)table5,table6
> (6)table7,table8
>
> table5 and table6 have fk keys pointing to table1,table2,table3,table4.
> table7 and table 8 have fk keys pointing to table5.
>
> Here is my problem i have delete triggers on table5 and table6 which
> update summary information on table1,table2,table3,table4 if table5 or 6
> gets delete, problem i am faced with is when eg table1 record gets
> deleted i get the following error Error insert or update on table5
> violates foreign key constraint "table4". They are all link with a
> cascade delete.

We're probably not going to be much help without more information about
the details of the triggers and tables involved such as what operations
the triggers do to do the summary update and whether they're defined as
before or after triggers.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message richyen3@gmail.com 2006-10-31 00:34:17 creating a dumpfile from a view
Previous Message Richard Yen 2006-10-31 00:02:45 creating a dumpfile from a view