I try to understand, how that SQL command works:
BEGIN;
UPDATE post SET hits = hits + 1;
-- run from another session: DELETE FROM post WHERE hits = 10;
COMMIT;
Let's say, we hahe a rows with hits = 9 and 10. Then we run that query, and then what? What (and why) will our rows look like?
commitin the first session.