su - postgres
psql -d aflmdata -U aflm1234
psql -U aflm1234 -W
postgres=# create user <USER_NAME> with password '******';
CREATE ROLE
postgres=# create database <DB_NAME> owner <USER_NAME>;
CREATE DATABASE
postgres=# grant all privileges on database <DB_NAME> to<USER_NAME>;
GRANT
postgres=# \q
-bash-4.2$ exit
alter user ** with password '';
列出所有数据库:\l 或 select datname from pg_database;
切换数据库:\c 数据库
查询最大连接数
select count(1) from pg_stat_activity;
查看当前连接数
show max_connections;
修改最大连接数
cd /nfsc/csp_stg_fls_afch_id009044_vol1001_stg/postgresql && vim postgresql.conf