create or replace procedure tps() as $$ declare v1 int8; v2 int8; begin select txid_snapshot_xmax(txid_current_snapshot()) into v1; commit; perform pg_sleep(1); select txid_snapshot_xmax(txid_current_snapshot()) into v2; commit; raise notice 'tps: %', v2-v1; end; $$ language plpgsql ;