Skip to content

Instantly share code, notes, and snippets.

@MartinThoma
Created October 10, 2021 14:29
Show Gist options
  • Save MartinThoma/949a7c13dff9e74165a1cb3f6dca3a26 to your computer and use it in GitHub Desktop.
Save MartinThoma/949a7c13dff9e74165a1cb3f6dca3a26 to your computer and use it in GitHub Desktop.
start transaction isolation level read committed;
SELECT * FROM balances ORDER BY id;
id | balance
-------+---------
Alice | 500
Bob | 500
(2 rows)
UPDATE balances SET balance = 100 WHERE id = 'Bob';
UPDATE balances SET balance = balance - 50 WHERE id = 'Bob';
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment