concurent updates - Mailing list pgsql-general

From Steve SAUTETNER
Subject concurent updates
Date
Msg-id BKEHJDOFOAHJBCOBCHJGKEHACCAA.ssa@informactis.com
Whole thread Raw
Responses Re: concurent updates  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List 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.


pgsql-general by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: ODBC PG error
Next
From: Joel Burton
Date:
Subject: Re: diff's between creations of tables