DROP SEQUENCE IF EXISTS toto;
CREATE TEMP TABLE results (id int, begin_lsn pg_lsn, end_lsn pg_lsn);
INSERT INTO results VALUES (1, pg_current_xlog_location(), NULL);
CREATE SEQUENCE TOTO;
DO $$DECLARE count integer; count2 integer;
begin
for count in 1 .. 1000000
loop
select nextval('toto') into count2;
end loop;
END$$;
UPDATE results SET end_lsn = pg_current_xlog_location() WHERE id = 1;
SELECT pg_size_pretty(end_lsn - begin_lsn) from results;
