Question: update and transaction isolation - Mailing list pgsql-hackers

From mlw
Subject Question: update and transaction isolation
Date
Msg-id 3CAB192B.B805254A@mohawksoft.com
Whole thread Raw
Responses Re: Question: update and transaction isolation  (Peter Eisentraut <peter_e@gmx.net>)
List 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?


pgsql-hackers by date:

Previous
From: Mikhail Terekhov
Date:
Subject: Re: notification: pg_notify ?
Next
From: mlw
Date:
Subject: Re: Suggestions please: names for function cachability attributes