DROP TABLE IF EXISTS t1;
CREATE TABLE t1(id integer, val text);
INSERT INTO t1 SELECT i, 'val' FROM generate_series(1, 500) i;

BEGIN;
SAVEPOINT s1;
SELECT 1 FROM t1 WHERE id = 123 FOR UPDATE;
UPDATE t1 SET val = 'hoho' WHERE id = 123;
release s1;
savepoint s1;
SELECT 1 FROM t1 WHERE id = 123 FOR UPDATE;
UPDATE t1 SET val = 'hoho' WHERE id = 123;
COMMIT;
