Re: POSTGRES BUG - FIX IT PLEASE - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: POSTGRES BUG - FIX IT PLEASE
Date
Msg-id Pine.LNX.4.21.0010102137460.759-100000@peter.localdomain
Whole thread Raw
In response to POSTGRES BUG - FIX IT PLEASE  (Sergey Mavrinsky <mavr@solvo.ru>)
List pgsql-bugs
Sergey Mavrinsky writes:

> create table t1
> (
>         f1 integer,
>         f2 integer
> );
>
> create table t2
> (
>         f1 integer references t1(f1),
>         f2 integer
> );

> begin transaction;
> insert into t1(f1,f2) values(1,1);
> delete from t1 where f1=1;

> ERROR:  triggered data change violation on relation "t1"

You cannot change data twice within a transaction if there's a RI
constraint on the table.  This is per SQL, nothing we can do about it.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Referencial integrity when there are timestamp primary keys
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] RE: POSTGRES BUG - FIX IT PLEASE