Question: update and transaction isolation

From: mlw <markw(at)mohawksoft(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Question: update and transaction isolation
Date: 2002-04-03 15:00:59
Message-ID: 3CAB192B.B805254A@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Take this update statement:

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?

I am assumed that foo will always be correct and that the database will manage
any contention, but when I think about transaction isolation, I'm not so sure.
Is it possible for two or more instances of this update to run simultaneously,
each getting the same value for foo, then each updating foo to the same
incremented value?

Is this a stupid question?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2002-04-03 15:02:15 Re: Suggestions please: names for function cachability attributes
Previous Message mlw 2002-04-03 14:20:11 Question: update and transaction isolation