diff --git a/t/027_local_blocks.pl b/t/027_local_blocks.pl index be2d52b..f45b939 100644 --- a/t/027_local_blocks.pl +++ b/t/027_local_blocks.pl @@ -70,9 +70,13 @@ is($stdout,'t',"Check: local_blks_hit should not be 0."); trim($stdout); is($stdout,'t',"Check: local_blks_dirtied should not be 0."); -($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.local_blk_write_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%INSERT INTO t1%\'', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); -trim($stdout); -is($stdout,'t',"Check: local_blk_write_time should not be 0."); +if ($PGSM::PG_MAJOR_VERSION => 17) +{ + ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.local_blk_write_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%INSERT INTO t1%\'', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); + trim($stdout); + is($stdout,'t',"Check: local_blk_write_time should not be 0."); +} + # Compare values for query 'SELECT * FROM t1' ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT PGSM.local_blks_hit != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); @@ -80,9 +84,12 @@ trim($stdout); is($stdout,'t',"Check: local_blks_hit should not be 0."); # TODO: Find a way how to bypass cache and ger real block reads -# ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.local_blk_read_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); -# trim($stdout); -# is($stdout,'t',"Check: local_blk_read_time should not be 0."); +# if ($PGSM::PG_MAJOR_VERSION => 17) +# { +# ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.local_blk_read_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); +# trim($stdout); +# is($stdout,'t',"Check: local_blk_read_time should not be 0."); +# } # DROP EXTENSION $stdout = $node->safe_psql('postgres', 'DROP EXTENSION pg_stat_monitor;', extra_params => ['-a']);