\set ON_ERROR_STOP 1
;SELECT 'BEGIN;' UNION ALL SELECT format('DROP TABLE IF EXISTS %1$s; CREATE TABLE %1$s(id serial primary key, data text not null); INSERT INTO %1$s (data) VALUES(17);', 'copytest_'||g.i) FROM generate_series(0, 10000) g(i) UNION ALL SELECT 'COMMIT;';\gexec
