(unnamed)
text/plain
#! /usr/bin/perl
use strict;
my $ndbs = 100; # number of databases
my $ntbls = 100; # number of tables per database
for (my $i = 0 ; $i < $ndbs ; $i++)
{
system(sprintf("dropdb db%03d;\n", $i));
system(sprintf("createdb db%03d;\n", $i));
for (my $j = 0 ; $j < $ntbls ; $j++)
{
system(sprintf("psql db%03d -c \"drop table if exists t%03d; create table t%03d as select v as a, v * 2 as b,v * 3 as c, v * 4 as d from generate_series(0, 9) v;\"", $i, $j, $j));
}
}