Обсуждение: data change violation inside transaction

Поиск
Список
Период
Сортировка

data change violation inside transaction

От
Matt Beauregard
Дата:
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