CREATE PROCEDURE crashme()
 LANGUAGE plpgsql
AS $procedure$
  DECLARE id_ int;
  BEGIN
    FOR id_ IN SELECT 1/(x-1000) from GENERATE_SERIES(1,1000) x LOOP
        COMMIT;
    END LOOP;
  END;
$procedure$;

call crashme();
