create table if not exists test_extend (num int, str text);
truncate table test_extend;

-- fill in 11 blocks with as many large records (7 tuples per page) as will fit
insert into test_extend select g, rpad('', 1024, 'a') from generate_series(0,7*11 - 1) g;

alter system set client_min_messages to DEBUG1;
select pg_reload_conf();

-- clear some space on block 4 and create FSM
delete from test_extend where num / 7 = 4;
vacuum test_extend;
select pg_relation_size('test_extend', 'main') as heap, pg_relation_size('test_extend', 'fsm') as fsm;

-- insert large record and make sure it doesn't extend
insert into test_extend values (101, rpad('', 1024, 'a'));
select pg_relation_size('test_extend', 'main') as heap, pg_relation_size('test_extend', 'fsm') as fsm;

alter system set client_min_messages to DEFAULT;
select pg_reload_conf();
