Re: UPDATE ... RETURNING atomicity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: rihad <rihad(at)mail(dot)ru>, pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE ... RETURNING atomicity
Date: 2010-05-23 15:19:33
Message-ID: 14702.1274627973@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryzman(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2010-05-23 16:03:26 Re: Full text search on a complex schema - a classic problem?
Previous Message Grzegorz Jaśkiewicz 2010-05-23 11:07:22 Re: UPDATE ... RETURNING atomicity