PostgreSQL与MySQL语法有一些细微差异,记录一下PostgreSQL常用的SQL语句。
create database test;
create user test with password 'test';
grant all privileges on database test to test;
grant all privileges on all tables in schema public to test;
# 统计当前所有连接数
select count(1) from pg_stat_activity;
# 查询当前连接数详细信息
select * from pg_stat_activity;
# 查询最大连接数
show max_connections;