Stabilize btree_gist test against on-access VM setting

The btree_gist enum test expects a bitmap heap scan. Since b46e1e54d0
enabled setting the VM during on-access pruning and 378a21618 set
pd_prune_xid on INSERT, scans of enumtmp may set pages all-visible.
If autovacuum or autoanalyze then updates pg_class.relallvisible, the
planner could choose an index-only scan instead.

Make the enumtmp a temp table to exclude it from autovacuum/autoanalyze.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/46733d68-aec0-4d09-8120-4c66b87047a4%40gmail.com
This commit is contained in:
Melanie Plageman 2026-04-21 17:32:45 -04:00
parent 85ae8ab053
commit 62407d26b7
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ create type rainbow as enum ('r','o','g','b','i','v');
-- enum values added later take some different codepaths internally,
-- so make sure we have coverage for those too
alter type rainbow add value 'y' before 'g';
CREATE TABLE enumtmp (a rainbow);
CREATE TEMPORARY TABLE enumtmp (a rainbow);
\copy enumtmp from 'data/enum.data'
SET enable_seqscan=on;
select a, count(*) from enumtmp group by a order by 1;

View file

@ -6,7 +6,7 @@ create type rainbow as enum ('r','o','g','b','i','v');
-- so make sure we have coverage for those too
alter type rainbow add value 'y' before 'g';
CREATE TABLE enumtmp (a rainbow);
CREATE TEMPORARY TABLE enumtmp (a rainbow);
\copy enumtmp from 'data/enum.data'