Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

Поиск
Список
Период
Сортировка
От jian he
Тема Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Дата
Msg-id CACJufxGimJaujnF2O1f=NRW6yeORx4bP1=RSVMQ46Lc8Gmqf3Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Extension Enhancement: Buffer Invalidation in pg_buffercache  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers


On Sat, Jul 1, 2023 at 6:09 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>
>
> It should be restricted by role, but I wonder which role it should be.
> Testing for superuser is now out of fashion.
>

as pg_buffercache/pg_buffercache--1.2--1.3.sql. You need pg_maintain privilege to use pg_buffercache.
The following query works on a single user. Obviously you need a role who can gain pg_monitor privilege.

begin;
create role test login nosuperuser;
grant select, insert on onek to test;
grant pg_monitor to test;
set role test;
select count(*) from onek;
insert into onek values(default);
(SELECT count(*) FROM pg_buffercache WHERE relfilenode = pg_relation_filenode('onek'::regclass))
except
(
select count(pg_buffercache_invalidate(bufferid))
from    pg_buffercache   where relfilenode = pg_relation_filenode('onek'::regclass)
);

rollback;

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Soumyadeep Chakraborty
Дата:
Сообщение: Re: brininsert optimization opportunity
Следующее
От: torikoshia
Дата:
Сообщение: Make --help output fit within 80 columns per line