create extension pg_visibility;

drop table if exists t;
create table t (a int, b text);
insert into t select i, (select string_agg(md5(random()::text), '') from generate_series(1,100)) from generate_series(1,200000) s(i);
copy t to '/tmp/t.data';
drop table t;

begin;
create table t (a int, b text);
copy t from '/tmp/t.data' freeze;

select * from pg_visibility('t');
select * from pg_visibility((select reltoastrelid from pg_class where relname = 't'));


select count(*) from pg_visibility('t');
select count(*) from pg_visibility('t') where not all_visible;


select count(*) from pg_visibility((select reltoastrelid from pg_class where relname = 't'));
select count(*) from pg_visibility((select reltoastrelid from pg_class where relname = 't')) where not all_visible;
