Re: UPDATE ... RETURNING atomicity - Mailing list pgsql-general

From Tom Lane
Subject Re: UPDATE ... RETURNING atomicity
Date
Msg-id 14702.1274627973@sss.pgh.pa.us
Whole thread Raw
In response to Re: UPDATE ... RETURNING atomicity  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Responses Re: UPDATE ... RETURNING atomicity  (rihad <rihad@mail.ru>)
List pgsql-general
=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryzman@gmail.com> writes:
> find in docs part that talks about transaction isolation levels, and
> translate it to your problem.

Yes, please read the fine manual:
http://www.postgresql.org/docs/8.4/static/mvcc.html

What I think will happen in your example is that all concurrent
executions will locate the same row-to-be-updated.  The first one to get
to the row "wins" and updates the row.  All the rest will fail, either
updating no rows (if not serializable) or throwing an error (if
serializable).

            regards, tom lane

pgsql-general by date:

Previous
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: UPDATE ... RETURNING atomicity
Next
From: Andy Colson
Date:
Subject: Re: Full text search on a complex schema - a classic problem?