- 查询数据库允许的最大连接数:
show max_connections;
查询结果:
| max_connections |
|---|
| 1000 |
- 查询数据库当前连接数脚本:
select count(*), usename from pg_stat_activity group by usename;
查询结果:
| count | username |
|---|---|
| 4 | null |
| 16 | "ichemmang" |
| 1 | "postgres" |
show max_connections;
查询结果:
| max_connections |
|---|
| 1000 |
select count(*), usename from pg_stat_activity group by usename;
查询结果:
| count | username |
|---|---|
| 4 | null |
| 16 | "ichemmang" |
| 1 | "postgres" |
本文标题:查看postgres数据库连接数
本文链接:https://www.haomeiwen.com/subject/aogobrtx.html
网友评论