作者
digoal
日期
2018-11-20
标签
PostgreSQL , session_preload_libraries , psql: FATAL: could not access file "pg_pathman": No such file or directory
背景
由于粗心,设错了session_preload_libraries,里面包含了一个不存在的SO,连接数据库报错:
postgres=# alter role all set session_preload_libraries='pg_pathman';
ALTER ROLE
postgres=# \q
postgres@pg11-test-> psql
psql: FATAL: could not access file "pg_pathman": No such file or directory
补救方法
1、session_preload_libraries是一个会话可设置的参数,所以可以在连接时直接指定为正确值,例如
```
postgres@pg11-test-> psql options=-csession_preload_libraries='auto_explain'
psql (11.1)
Type "help" for help.
postgres=# show session_preload_libraries ;
session_preload_libraries
auto_explain
(1 row)
```
或者
```
postgres@pg11-test-> psql options=-csession_preload_libraries=''
psql (11.1)
Type "help" for help.
postgres=# show session_preload_libraries ;
session_preload_libraries
(1 row)
```
进入数据库后,重新设置为正确值,或者重置即可:
postgres=# alter role all reset session_preload_libraries;
ALTER ROLE
PostgreSQL 许愿链接
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.
9.9元购买3个月阿里云RDS PostgreSQL实例
PostgreSQL 解决方案集合
德哥 / digoal's github - 公益是一辈子的事.





