ERROR: Triggered data change violation.

From: "Constantin S(dot) Svintsoff" <cs(at)newst(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: ERROR: Triggered data change violation.
Date: 2001-11-01 11:41:51
Message-ID: Pine.BSF.4.21.0111011717050.40751-100000@lizard.plesk.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi, there!

If I have two tables, first with primary key, second references to first
and in one transaction I insert row in any of these tables and when try to
delete it, I receive :

ERROR: triggered data change violation on relation 'xxx'

Here is an example:

temp=# CREATE TABLE prim (i int primary key);
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'prim_pkey'
for table 'prim'
CREATE
temp=# create table fore (j int references prim);
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
CREATE
temp=# insert into prim values(1);
INSERT 85836 1
temp=# begin;
BEGIN
temp=# INSERT INTO fore values (1);
INSERT 85837 1
temp=# delete from fore;
ERROR: triggered data change violation on relation "fore"
temp=# rollback;
ROLLBACK
temp=# begin;
BEGIN
temp=# INSERT INTO prim VALUES (2);
INSERT 85880 1
temp=# DELETE from prim where i = 2;
ERROR: triggered data change violation on relation "prim"
temp=# rollback;
ROLLBACK
temp=# select version();
version
-------------------------------------------------------------
PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

/Constantin

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2001-11-01 14:56:17 Server going down for several hours ...
Previous Message Klaus Reger 2001-11-01 07:02:01 import/export of large objects on server-side