
-- check replication count
select * from pg_stat_replication;

-- create table
drop table tbl_timestamp0;
create table tbl_timestamp0 (d1 timestamp(0) without time zone);

-- create brin index
create index on tbl_timestamp0 using brin (d1) with (pages_per_range = 1, autosummarize=false);

-- prepare data
insert into tbl_timestamp0 select i from generate_series(TIMESTAMPTZ '2011-03-27 08:14:01.123456789 Europe/Moscow', TIMESTAMPTZ '2011-03-27 03:14:04.0123456789 Europe/Moscow'+'100 days'::interval, '28 SECOND') i;

-- do summarize
VACUUM tbl_timestamp0;

select pg_sleep(2);

-- recheck replication count, standby lost
select * from pg_stat_replication;
