CREATE OR REPLACE FUNCTION alter_sequence() RETURNS void AS $$
DECLARE
    v INT;
BEGIN
    v := 1 + (random() * 999)::int;
    execute format('alter sequence s%s restart with 1000', v);
    perform nextval('s');
END;
$$ LANGUAGE plpgsql;


CREATE OR REPLACE FUNCTION alter_sequence2() RETURNS void AS $$
DECLARE
    v INT;
BEGIN
    v := 1 + (random() * 999)::int;
    execute format('alter sequence s%s restart with 1000', v);
END;
$$ LANGUAGE plpgsql;


CREATE OR REPLACE FUNCTION create_table() RETURNS void AS $$
DECLARE
    v INT;
BEGIN
    v := 1 + (random() * 999)::int;
    execute format('create table t%s (a int)', v);
    execute format('drop table t%s', v);
    insert into t values (1);
END;
$$ LANGUAGE plpgsql;
