\setrandom ref 1 20
BEGIN;
SELECT * FROM referenced WHERE referenced_id = :ref FOR KEY SHARE;
SAVEPOINT f;
UPDATE referenced SET data = data WHERE referenced_id = :ref;
ROLLBACK TO SAVEPOINT f;
COMMIT;
