\set c1 random(1, 100) do $$ begin for i in 1 .. :c1 loop insert into t values (ceil(random() * 131072)); end loop; end; $$;