@@ -36,19 +36,23 @@ INSERT INTO heaptest (a, b)
3636--
3737-- Create an alternative tablespace and move the heaptest table to it, causing
3838-- it to be rewritten and all the blocks to reliably evicted from shared
39- -- buffers -- guaranteeing actual reads when we next select from it.
39+ -- buffers -- guaranteeing actual reads when we next select from it in the
40+ -- same transaction. The heaptest table is smaller than the default
41+ -- wal_skip_threshold, so a wal_level=minimal commit reads the table into
42+ -- shared_buffers. A transaction delays that and excludes any autovacuum.
4043SET allow_in_place_tablespaces= true;
4144CREATE TABLESPACE regress_test_stats_tblspc LOCATION' ' ;
4245SELECT sum (reads)AS stats_bulkreads_before
4346FROM pg_stat_ioWHERE context= ' bulkread' \gset
47+ BEGIN ;
4448ALTER TABLE heaptestSET TABLESPACE regress_test_stats_tblspc;
45-
4649-- Check that valid options are not rejected nor corruption reported
4750-- for a non-empty table
4851SELECT * FROM verify_heapam(relation := ' heaptest' , skip := ' none' );
4952SELECT * FROM verify_heapam(relation := ' heaptest' , skip := ' all-frozen' );
5053SELECT * FROM verify_heapam(relation := ' heaptest' , skip := ' all-visible' );
5154SELECT * FROM verify_heapam(relation := ' heaptest' , startblock := 0 , endblock := 0 );
55+ COMMIT ;
5256
5357-- verify_heapam should have read in the page written out by
5458-- ALTER TABLE ... SET TABLESPACE ...