1 /* contrib/pg_buffercache/pg_buffercache--1.1.sql */
3 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
4 \echo Use "CREATE EXTENSION pg_buffercache" to load this file. \quit
6 -- Register the function.
7 CREATE FUNCTION pg_buffercache_pages()
9 AS 'MODULE_PATHNAME', 'pg_buffercache_pages'
12 -- Create a view for convenient access.
13 CREATE VIEW pg_buffercache AS
14 SELECT P.* FROM pg_buffercache_pages() AS P
15 (bufferid integer, relfilenode oid, reltablespace oid, reldatabase oid,
16 relforknumber int2, relblocknumber int8, isdirty bool, usagecount int2,
17 pinning_backends int4);
19 -- Don't want these to be available to public.
20 REVOKE ALL ON FUNCTION pg_buffercache_pages() FROM PUBLIC;
21 REVOKE ALL ON pg_buffercache FROM PUBLIC;