【发布时间】:2018-11-05 16:35:10
【问题描述】:
我们的 postgres 数据库(在 Debian 上安装的 9.4 版)停止工作(它已经工作了几个月没有问题)。当我尝试使用 psql 连接时,我得到:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
当我检查状态时,它似乎没问题:
service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled)
Active: active (exited) since Mon 2018-11-05 17:04:58 CET; 31s ago
Process: 1367 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 1367 (code=exited, status=0/SUCCESS)
我尝试重启服务器
service postgresql restart
在日志文件中我得到了
FATAL: could not access file "pg_stat_statements": No such file or directory
我试图找到解决方案。大多数答案是 pg_stat_statements 模块存在问题。我检查了 /etc/postgresql/9.4/main/postgres.conf 文件,但该行被注释:
#shared_preload_libraries = '' # (change requires restart)
据我所知,我们没有更改任何 postgres 配置文件,最近也没有进行任何升级或更新。提前感谢您的帮助。
【问题讨论】: