PostgreSQL基本命令

本文内容总结PostgreSQL一些基本命令

以下:

命令行登陆数据库操作

1
psql -h pgm   -p 3433 -U rooot -d uat

查看数据库剩余连接数

1
select max_conn-now_conn as resi_conn from (select setting::int8 as max_conn,(select count(*) from pg_stat_activity) as now_conn from pg_settings where name = 'max_connections') t;
-->