CREATE OR REPLACE FUNCTION maketables() RETURNS void AS $$
DECLARE
	i INTEGER;
BEGIN
	FOR i IN SELECT * FROM generate_series(1,100) LOOP
		EXECUTE 'CREATE TABLE a' || i
			|| ' (id serial, name varchar, PRIMARY KEY (id))';
		EXECUTE 'CREATE TABLE b' || i
			|| ' (id serial, name varchar, PRIMARY KEY (id)) TABLESPACE dork';
	END LOOP;
END
$$ LANGUAGE plpgsql;
