Re: Question: update and transaction isolation

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question: update and transaction isolation
Date: 2002-04-03 17:12:41
Message-ID: Pine.LNX.4.30.0204031209410.684-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

mlw writes:

> update mytable set foo=foo+1 where bar='xxx';
>
> If that gets executed more than once at the same time by multiple instances of
> postgresql. Will foo ever lose a count?

No, but if you run this in read committed isolation mode then you might
get into non-repeatable read type problems, i.e., you run it twice but
every foo was only increased once. If you use serializable mode then all
but one concurrent update will be aborted.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martin Renters 2002-04-03 17:16:21 Re: Suggestions please: names for function cachability
Previous Message mlw 2002-04-03 17:10:45 Re: Suggestions please: names for function cachability