Reputation: 395
For example, to prevent two users concurrently updating the same wiki page, you might try something like this, expecting the update to occur only if the content of the page hasn’t changed since the user started editing it:
UPDATE wiki_pages SET content = 'new content'
WHERE id = 1234 AND content = 'old content';
Is it safe (can it prevent lost updates) in Postgresql with READ_COMMITTED (default) isolation level?
Upvotes: 0
Views: 75