自己安装的openGauss环境
启动openGauss
gs_ctl -D /gauss/data/db1/ start
登录openGauss
gsql -d postgres -p 26000 -r
1.创建用户user1、user2和user3,user1具有CREATEROLE权限,user2具有CREATEDB权限,要求使用两种不同的方法设置密码
\du
create user user1 CREATEROLE password ‘Test_@1111’;
create user user2 CREATEDB identified by ‘Test_@2222’;
create user user3 LOGIN identified by ‘Test_@3333’;
\du
2.修改用户user1的密码
alter user user1 identified by ‘Test_@54321’;
3.重命名用户user2
alter user user2 rename to user20;
\du
4.将用户user1的权限授权给用户user3,再回收用户user3的权限
grant user1 to user3;
\du+ user3
revoke user1 from user3;
\du+ user3
5.删除所有创建用户
drop user user1;
drop user user20;
drop user user3;
\du