remaining connection slots are reserved for non-replication superuser connections


使用客戶端工具連接pg,連接失敗,報錯以下錯誤:

FATAL: remaining connection slots are reserved for non-replication superuser connections 

查看數據庫連接狀態和配置信息

select * from pg_stat_activity where pid<>pg_backend_pid() and state='idle';##pg_backend_pid()的結果是當前會話的pid
select datname,datconnlimit from pg_database ;
select current_setting('max_connections');
select current_setting('superuser_reserved_connections');

  

發現參數max_connections設置太低。

因為是測試環境,就先把idle狀態的連接先殺掉:

##把數據庫中的所有的空閑會話全部kill掉
select pg_terminate_backend(pid) from pg_stat_activity where pid<>pg_backend_pid() and state='idle';

 然后修改參數max_connections的值。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM