psql -c 'drop table if exists t'
psql -c 'create table t (i bigint);'

while true
do
	psql -c "VACUUM FULL pg_toast.pg_toast_2619;"
	psql -c "VACUUM FULL pg_statistic;"
done &

while true
do
	psql -c "INSERT INTO t SELECT i FROM generate_series(1,999999) i"
	sleep 1
	for a in `seq 999`
	do
		psql -c "ALTER TABLE t ALTER i TYPE int USING i::int"
		sleep 1
		psql -c "ALTER TABLE t ALTER i TYPE bigint"
		sleep 1
	done
	psql -c "TRUNCATE t"
done &

wait
wait





