Re: PD: triggered data change violation on relation "tbl_b" - Mailing list pgsql-bugs

From Andreas Wernitznig
Subject Re: PD: triggered data change violation on relation "tbl_b"
Date
Msg-id 20010829132054.2a87f6b3.andreas@insilico.com
Whole thread Raw
In response to PD: triggered data change violation on relation "tbl_b"  ("Pawel Pawlowski" <pawel.pawlowski@breitenbach.pl>)
List pgsql-bugs
You cannot insert and delete the same data within one transaction.
Only one change of a row is allowed.

Greetings
Andreas

On Wed, 29 Aug 2001 13:18:02 +0200
"Pawel Pawlowski" <pawel.pawlowski@breitenbach.pl> wrote:

> When I insert to table new row and after this in the same transaction I delete this row I get such error:
> triggered data change violation on relation "tbl_b"
>
> I've created database using simple script:
>
> CREATE TABLE tbl_a
> (
>   pn_id         SERIAL,
>   pn_a  VARCHAR(400) NOT NULL,
>   PRIMARY KEY (pn_id)
> );
> CREATE TABLE tbl_b
> (
>   pc_id      INT4 NOT NULL REFERENCES tbl_a (pn_id) ON UPDATE CASCADE ON DELETE CASCADE,
>   pc_b       VARCHAR(40) NOT NULL,
>   PRIMARY KEY (pc_id, pc_b)
> );
> INSERT INTO tbl_a VALUES (1, 'xxx');
>
> And this is the sample script that I use to generete this bug:
>
> begin transaction;
> insert into tbl_b values (1, 'xxx');
> delete from tbl_b where pc_id=1;
> ERROR:  triggered data change violation on relation "tbl_b"
>
> How to solve this problem ?????



------------------------------
      Andreas Wernitznig
    Insilico Software GmbH
 E-Mail: andreas@insilico.com
    Web: www.insilico.com
------------------------------

pgsql-bugs by date:

Previous
From: "Pawel Pawlowski"
Date:
Subject: PD: triggered data change violation on relation "tbl_b"
Next
From: "Pawel Pawlowski"
Date:
Subject: Odp: PD: triggered data change violation on relation "tbl_b"