ERROR: relation "pg_buffercache" does not exist

建立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;
相关文章
相关标签/搜索