建立pg_buffercache後,查詢時報錯:sql
postgres=# create extension pg_buffercache; postgres=# select * from pg_buffercache; ERROR: relation "pg_buffercache" does not exist LINE 1: select * from pg_buffercache;
緣由:消息'relation does not exist'一般是由於沒有鏈接到相應數據庫。由於我只是psql鏈接後,沒有切換到某個數據庫。數據庫
解決方法:post
\c yourDb yourDb=# CREATE EXTENSION IF NOT EXISTS pg_buffercache; yourDb=# SELECT count(*) FROM pg_buffercache;