Re: Atomicity?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Naz Gassiep <naz(at)mira(dot)net>
Cc: Michael Glaesemann <grzm(at)seespotcode(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Atomicity?
Date: 2006-08-28 20:33:48
Message-ID: 17657.1156797228@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Naz Gassiep <naz(at)mira(dot)net> writes:
> I would like more information on this deficiency and what causes it so I
> know when to anticipate it.

The uniqueness constraint is checked on a row-by-row basis, so if you
update one row to hold the same value as another row holds, you get an
error immediately. It doesn't matter that if the query had been allowed
to finish, it would have updated that other row to some non-conflicting
value. (You might be able to work around this if you could control the
order in which rows are updated, but you can't.)

This is not what the SQL spec says should happen, but so far no one has
proposed a reimplementation that doesn't give up unreasonable amounts
of performance. It's on the TODO list ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-08-28 20:37:17 Re: Atomicity?
Previous Message Tony Caduto 2006-08-28 20:32:51 Postgresql mentioned on Newsforge MySQL article