From 6e566b58cec918ec258275935dcef0f6cab03dc3 Mon Sep 17 00:00:00 2001 From: shihao zhong Date: Thu, 22 Oct 2026 22:36:39 -0400 Subject: [PATCH] Read VM bits past the heap end in 013_vm_truncation --- src/bin/pg_combinebackup/t/013_vm_truncation.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_combinebackup/t/013_vm_truncation.pl b/src/bin/pg_combinebackup/t/013_vm_truncation.pl index b313c2ebe81..029c5bbfc9a 100644 --- a/src/bin/pg_combinebackup/t/013_vm_truncation.pl +++ b/src/bin/pg_combinebackup/t/013_vm_truncation.pl @@ -37,8 +37,11 @@ $primary->safe_psql('postgres', 'VACUUM (FREEZE, TRUNCATE false) t'); my $heap_blocks_sql = q{SELECT pg_relation_size('t') / current_setting('block_size')::int}; -my $vm_summary_sql = - q{SELECT all_visible, all_frozen FROM pg_visibility_map_summary('t')}; +# Read the VM bits of every block the table ever had. Before v19, +# pg_visibility_map_summary() stops at the end of the heap. +my $vm_summary_sql = q{ + SELECT count(*) FILTER (WHERE all_visible), count(*) FILTER (WHERE all_frozen) + FROM generate_series(0, 7) AS b, pg_visibility_map('t', b)}; is($primary->safe_psql('postgres', $heap_blocks_sql), '8', 'empty tail pages remain before full backup'); -- 2.37.1 (Apple Git-137.1)