[thelist] Atomic database updates

Bill Moseley moseley at hank.org
Tue Nov 8 05:39:49 CST 2011


I need only one process to change the "state" of a row.  This is with
Postgresql.

UPDATE
    foo
SET
    state = 'processing'
WHERE
    id = <foo id>
    state = 'ready'

Are there times when that might not be atomic?  Is it possible more than
one process could run that update and be told that 1 row was updated?


Thanks,

-- 
Bill Moseley
moseley at hank.org


More information about the thelist mailing list