concurent updates

From: "Steve SAUTETNER" <ssa(at)informactis(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: concurent updates
Date: 2001-07-26 09:19:36
Message-ID: BKEHJDOFOAHJBCOBCHJGKEHACCAA.ssa@informactis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi everybody !

I've got a little problem when updating a primary key in two table
where the primary key of the one is a foreign key from the second :

here are the 2 tables :

create table table1 (id int primary key, col1 int);
create table table2 (id int primary key references table1(id), col2 int);

and the 2 updates :

1) update table2 set id = 1001 where id = 1;
2) update table1 set id = 1001 where id = 1;

i can't execute them separately because of an integrity constraint
violation.
i've got the same error in a BEGIN / COMMIT block containing the updates.

Does any one see how two help me ?

thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2001-07-26 09:29:17 Re: diff's between creations of tables
Previous Message Hiroshi Inoue 2001-07-26 07:44:38 RE: ODBC PG error