Transaction and cascade problem

From: "Glenn MacGregor" <gtm(at)oracom(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Transaction and cascade problem
Date: 2001-12-20 13:47:57
Message-ID: 00e401c1895c$ee8e8a40$4d00a8c0@catamount
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi All,

I have postgres 7.1 set up with two tables (groups, users). groups has 2 columns name, groupid where id is the primary key autoincrement and name is unique. users has 3 columns name, userid, groupid. I have a constraint on users which syas that groupid must exists in the group table. I also have a cascade delete on the groups table to delete any users that are in the group I am removing. I regular (no transaction) mode everything works fine. When I start a transaction and I add a group to the group table, then delete it before a commit or rollback I get the following error:

ERROR: triggered data change violation on relation "groups"

After that the transaction must be rolledback. Any clues?

Thanks

Glenn

Browse pgsql-sql by date

  From Date Subject
Next Message Carl van Tast 2001-12-20 13:50:05 Re: subselects
Previous Message Glenn MacGregor 2001-12-20 13:32:26 Transaction and cascade problem