Skip to content

Commit 525de8d

Browse files
committed
Improve /contrib/pg_buffercache installation to use BEGIN/COMMIT,
improve examples. Mark Kirkwood
1 parent 136bea1 commit 525de8d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

contrib/pg_buffercache/README.pg_buffercache

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ Sample output
7676
isdirty boolean);
7777

7878
regression=# SELECT c.relname, count(*) AS buffers
79-
FROM pg_class c, pg_buffercache b
80-
WHERE b.relfilenode = c.relfilenode
79+
FROM pg_class c INNER JOIN pg_buffercache b
80+
ON b.relfilenode = c.relfilenode INNER JOIN pg_database d
81+
ON (b.reldatabase = d.oid AND d.datname = current_database())
8182
GROUP BY c.relname
8283
ORDER BY 2 DESC LIMIT 10;
8384
relname | buffers

contrib/pg_buffercache/pg_buffercache.sql.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-- Adjust this setting to control where the objects get created.
2+
BEGIN;
23
SET search_path = public;
34

45
-- Register the function.
@@ -16,3 +17,5 @@ CREATE VIEW pg_buffercache AS
1617
-- Don't want these to be available at public.
1718
REVOKE ALL ON FUNCTION pg_buffercache_pages() FROM PUBLIC;
1819
REVOKE ALL ON pg_buffercache FROM PUBLIC;
20+
21+
COMMIT;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy