Debian Codegraph @

contrib/pg_buffercache/sql/pg_buffercache_numa.sql

raw
1 SELECT NOT(pg_numa_available()) AS skip_test \gset
2 \if :skip_test
3 \quit
4 \endif
5
6 -- We expect at least one entry for each buffer
7 select count(*) >= (select setting::bigint
8 from pg_settings
9 where name = 'shared_buffers')
10 from pg_buffercache_numa;
11
12 -- Check that the functions / views can't be accessed by default. To avoid
13 -- having to create a dedicated user, use the pg_database_owner pseudo-role.
14 SET ROLE pg_database_owner;
15 SELECT count(*) > 0 FROM pg_buffercache_numa;
16 RESET role;
17
18 -- Check that pg_monitor is allowed to query view / function
19 SET ROLE pg_monitor;
20 SELECT count(*) > 0 FROM pg_buffercache_numa;
21 RESET role;