步骤一:登录PostgreSQL

1
sudo  -u postgres psql

步骤二:修改登录PostgreSQL密码

1
ALTER USER postgres WITH PASSWORD  'postgres' ;

创建用户一:


create user ysr superuser password '123456';


创建用户二:

创建用户:create user username with login password 'password';

  1. grant all on all tables in schema schemaName to user; 给用户某个schema的所有权限