Re: Update is not atomic

From: Victor Wagner <vitus(at)ice(dot)ru>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Update is not atomic
Date: 2001-06-20 16:02:06
Message-ID: Pine.LNX.4.30.0106201959480.19755-100000@party.ice.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 20 Jun 2001, Peter Eisentraut wrote:

> From: Peter Eisentraut <peter_e(at)gmx(dot)net>
> Subject: Re: [BUGS] Update is not atomic
>
> Victor Wagner writes:
>
> > create table a (a numeric primary key);
> > insert into a values (1);
> > insert into a values (2);
> > insert into a values (3);
> > insert into a values (4);
> > update a set a=a+1 where a>2;
> > ERROR: Cannot insert a duplicate key into unique index a_pkey

> This is a known problem with unique contraints, but it's not easy to fix
> it.

Is there any known workaround?
Like specifying order of updates?

--
Victor Wagner vitus(at)ice(dot)ru
Chief Technical Officer Office:7-(095)-748-53-88
Communiware.Net Home: 7-(095)-135-46-61
http://www.communiware.net http://www.ice.ru/~vitus

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Mikheev, Vadim 2001-06-20 16:43:05 RE: Update is not atomic
Previous Message Peter Eisentraut 2001-06-20 16:00:32 Re: pg_dumpall problem