1. 程式人生 > 其它 >PostgreSQL 之連線數查詢修改

PostgreSQL 之連線數查詢修改

技術標籤:postgresql後臺資料庫postgresql後端

  • 當前總共正在使用的連線數
 select count(1) from pg_stat_activity;
  • 顯示系統允許的最大連線數
 show max_connections;
  • 顯示系統保留的使用者數
 show superuser_reserved_connections ;
  • 按照使用者分組檢視
select usename, count(*) from pg_stat_activity group by usename order by count(*) desc;
  • 修改最大連線數
alter system set max_connections= 數量

注意: 需要重啟後,修改的最大連線數生效!