Question: update and transaction isolation

From: mlw <markw(at)nospam(dot)not>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Question: update and transaction isolation
Date: 2002-04-03 14:20:11
Message-ID: 3CAB0F9B.1F6107D5@nospam.not
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?

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2002-04-03 15:00:59 Question: update and transaction isolation
Previous Message John Gray 2002-04-03 09:10:22 Re: command.c breakup