data change violation inside transaction - Mailing list pgsql-general

From Matt Beauregard
Subject data change violation inside transaction
Date
Msg-id 20010102165821.D2835@designscape.com.au
Whole thread Raw
List pgsql-general
While running the following set of statements:

create table category (
category_id serial not null primary key,
category_name text not null,
company_id int references company on delete cascade,
cattype_id int not null references cattype,
category_parent_id int not null references category
);
begin work;
insert into category (category_id, category_name, company_id, cattype_id, category_parent_id ) values (300, 'u2', 4,
25,0 ); 
delete from category where category_id = 300;


we get the error:

ERROR:  triggered data change violation on relation "category"


It goes away when we remove all the references from the table
definition, and isn't a problem outside a transaction, but we'd really
like it to work inside the transaction.  What's the reason for the
error and how can we fix it?


--
Matt Beauregard
Information Technology Operations, DesignScape

Ph: +61 2 9361 4233   Fx: +61 2 9361 4633

pgsql-general by date:

Previous
From: Frank Joerdens
Date:
Subject: unnecessary overhead on process startup
Next
From: GH
Date:
Subject: Two tables refenceing each other's columns