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
-- 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;
-- 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'