Improve /contrib/pg_buffercache installation to use BEGIN/COMMIT,
improve examples. Mark Kirkwood
This commit is contained in:
parent
136bea1540
commit
525de8d556
2 changed files with 6 additions and 2 deletions
|
@ -76,8 +76,9 @@ Sample output
|
||||||
isdirty boolean);
|
isdirty boolean);
|
||||||
|
|
||||||
regression=# SELECT c.relname, count(*) AS buffers
|
regression=# SELECT c.relname, count(*) AS buffers
|
||||||
FROM pg_class c, pg_buffercache b
|
FROM pg_class c INNER JOIN pg_buffercache b
|
||||||
WHERE b.relfilenode = c.relfilenode
|
ON b.relfilenode = c.relfilenode INNER JOIN pg_database d
|
||||||
|
ON (b.reldatabase = d.oid AND d.datname = current_database())
|
||||||
GROUP BY c.relname
|
GROUP BY c.relname
|
||||||
ORDER BY 2 DESC LIMIT 10;
|
ORDER BY 2 DESC LIMIT 10;
|
||||||
relname | buffers
|
relname | buffers
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
-- Adjust this setting to control where the objects get created.
|
-- Adjust this setting to control where the objects get created.
|
||||||
|
BEGIN;
|
||||||
SET search_path = public;
|
SET search_path = public;
|
||||||
|
|
||||||
-- Register the function.
|
-- Register the function.
|
||||||
|
@ -16,3 +17,5 @@ CREATE VIEW pg_buffercache AS
|
||||||
-- Don't want these to be available at public.
|
-- Don't want these to be available at public.
|
||||||
REVOKE ALL ON FUNCTION pg_buffercache_pages() FROM PUBLIC;
|
REVOKE ALL ON FUNCTION pg_buffercache_pages() FROM PUBLIC;
|
||||||
REVOKE ALL ON pg_buffercache FROM PUBLIC;
|
REVOKE ALL ON pg_buffercache FROM PUBLIC;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
Loading…
Reference in a new issue