Odp: PD: triggered data change violation on relation "tbl_b"

From: "Pawel Pawlowski" <pawel(dot)pawlowski(at)breitenbach(dot)pl>
To: <pgsql-bugs(at)postgresql(dot)org>, "Andreas Wernitznig" <andreas(at)insilico(dot)com>
Subject: Odp: PD: triggered data change violation on relation "tbl_b"
Date: 2001-08-29 11:43:15
Message-ID: 006101c1307f$ca032c70$3200000a@breitenbach.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Im changing now database from Interbase 6.0 to PosgreSql 7.1.2. With IB
there is no problem to do such things.
This problem only exist when I create table tbl_a with references
(REFERENCES tbl_a (pn_id) ON UPDATE CASCADE ON DELETE CASCADE). Without this
part everything works OK. So I think that problem is with triger.

----- Wiadomosc oryginalna -----
Od: "Andreas Wernitznig" <andreas(at)insilico(dot)com>
Do: "Pawel Pawlowski" <pawel(dot)pawlowski(at)breitenbach(dot)pl>
DW: <pgsql-bugs(at)postgresql(dot)org>
Wyslano: 29 sierpnia 2001 13:20
Temat: Re: [BUGS] PD: triggered data change violation on relation "tbl_b"

> 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(dot)pawlowski(at)breitenbach(dot)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(at)insilico(dot)com
> Web: www.insilico.com
> ------------------------------
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2001-08-29 18:27:52 Re: Odp: PD: triggered data change violation on relation "tbl_b"
Previous Message Andreas Wernitznig 2001-08-29 11:20:54 Re: PD: triggered data change violation on relation "tbl_b"