You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
postgres/contrib/pg_buffercache/pg_buffercache--1.6--1.7.sql

33 lines
1.2 KiB

/* contrib/pg_buffercache/pg_buffercache--1.6--1.7.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pg_buffercache UPDATE TO '1.7'" to load this file. \quit
-- Function to retrieve information about OS pages, with optional NUMA
-- information.
CREATE FUNCTION pg_buffercache_os_pages(IN include_numa boolean,
OUT bufferid integer,
OUT os_page_num bigint,
OUT numa_node integer)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'pg_buffercache_os_pages'
LANGUAGE C PARALLEL SAFE;
-- View for OS page information, without NUMA.
CREATE VIEW pg_buffercache_os_pages AS
SELECT bufferid, os_page_num
FROM pg_buffercache_os_pages(false);
-- Re-create view for OS page information, with NUMA.
DROP VIEW pg_buffercache_numa;
CREATE VIEW pg_buffercache_numa AS
SELECT bufferid, os_page_num, numa_node
FROM pg_buffercache_os_pages(true);
REVOKE ALL ON FUNCTION pg_buffercache_os_pages(boolean) FROM PUBLIC;
REVOKE ALL ON pg_buffercache_os_pages FROM PUBLIC;
REVOKE ALL ON pg_buffercache_numa FROM PUBLIC;
GRANT EXECUTE ON FUNCTION pg_buffercache_os_pages(boolean) TO pg_monitor;
GRANT SELECT ON pg_buffercache_os_pages TO pg_monitor;
GRANT SELECT ON pg_buffercache_numa TO pg_monitor;