]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Stabilize btree_gist test against on-access VM setting
authorMelanie Plageman <melanieplageman@gmail.com>
Tue, 21 Apr 2026 21:32:45 +0000 (17:32 -0400)
committerMelanie Plageman <melanieplageman@gmail.com>
Tue, 21 Apr 2026 21:32:45 +0000 (17:32 -0400)
The btree_gist enum test expects a bitmap heap scan. Since b46e1e54d07
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

contrib/btree_gist/expected/enum.out
contrib/btree_gist/sql/enum.sql

index 5782f43883859d326c2011b19e9099185f1a6c64..887cf0f7788c051af03a54cf3d9ea79e04c70735 100644 (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;
index d662cb63221021b303de16feb16406d5cea8c067..0cb5979a1dd7fbe5c2bb4c5079b0a410ec0eb1d1 100644 (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'