On Sun, 2008-11-09 at 17:12 -0500, Tom Lane wrote:
> Reviewing away ...
Thanks for reviewing.
> There's a fairly serious problem...
...
> Any thoughts about the best way to do it? My immediate inclination is
> to use heap_lock_tuple but it's a bit expensive.
Not sure how non-transactional tuple locking would/could work.
The user space solution to this problem is optimistic locking. i.e.
re-read the row immediately prior to the update. If row has changed,
keep re-reading it until it stays same, then update. Rely on block
locking to protect us. I'm tired and handwaving a lot.
Will think some more and report back.
-- Simon Riggs www.2ndQuadrant.comPostgreSQL Training, Services and Support