#!/bin/bash

myvar=$(for i in {1..2048};do printf "%s" "#"; done; printf "\n")

cat >toast_long.sql <<EOF
CREATE TABLE aa (a int, b text);
ALTER TABLE aa ALTER COLUMN b SET STORAGE EXTERNAL;
INSERT INTO aa values (generate_series(1, 10000000), '$myvar');
DROP TABLE aa;
EOF
