PostgreSQL操作随记:修订间差异
来自三线的随记
(创建页面,内容为“ PostgreSQL默认用户: postgres === 连接数相关 === ==== 配置文件 ==== sed "s/max_connections = .*/max_connections = 1024/" /var/lib/postgresql/data/…”) |
小无编辑摘要 |
||
第1行: | 第1行: | ||
PostgreSQL默认用户: postgres | PostgreSQL默认用户: postgres | ||
=== 连接数相关 === | ===连接数相关=== | ||
==== 配置文件 ==== | ====配置文件==== | ||
sed "s/max_connections = .*/max_connections = 1024/" /var/lib/postgresql/data/postgresql.conf|grep max_connection | sed "s/max_connections = .*/max_connections = 1024/" /var/lib/postgresql/data/postgresql.conf|grep max_connection | ||
==== commands ==== | ====commands==== | ||
===== 临时修改连接数(待验证) ===== | =====临时修改连接数(待验证)===== | ||
alter system set max_connections=1024 | alter system set max_connections=1024 | ||
<br /> | <br /> | ||
===== 查看连接数 ===== | =====查看连接数===== | ||
select count(1) from pg_stat_activity; | select count(1) from pg_stat_activity; | ||
<br /> | <br /> | ||
===== 查看最大连接数值 ===== | =====查看最大连接数值===== | ||
show max_connections; | show max_connections; | ||
<br /> | <br /> | ||
===== 查看保留连接数 ===== | =====查看保留连接数===== | ||
show superuser_reserved_connections; | show superuser_reserved_connections; | ||
<br /> | <br /> | ||
===== 查看连接的客户端信息 ===== | =====查看连接的客户端信息===== | ||
SELECT * FROM pg_stat_activity | SELECT * FROM pg_stat_activity | ||
<br /> | <br /> | ||
__强显目录__ | __强显目录__ | ||
[[分类:Linux]] | [[分类:Linux]] | ||
__无新段落链接__ | |||
__无编辑段落__ |
2021年6月15日 (二) 19:42的版本
PostgreSQL默认用户: postgres
连接数相关
配置文件
sed "s/max_connections = .*/max_connections = 1024/" /var/lib/postgresql/data/postgresql.conf|grep max_connection
commands
临时修改连接数(待验证)
alter system set max_connections=1024
查看连接数
select count(1) from pg_stat_activity;
查看最大连接数值
show max_connections;
查看保留连接数
show superuser_reserved_connections;
查看连接的客户端信息
SELECT * FROM pg_stat_activity