创建用户:
create user %s with %s password '%s';
删除用户:
drop user test;
修改密码:
ALTER ROLE test WITH PASSWORD 'test123';
锁定用户:
alter role test nologin;
alter role test connection limit 0;
解锁用户:
alter role test login;
alter role test connection limit -1;
为用户设置Comment:
Comment on role test is 'test';
删除Comment:
Comment on role test is NULL;
数据库:
创建数据库:
create database testdb with template='template0' encoding='UTF8' lc_collate='C' lc_ctype='en_US.utf8' owner='test';
删除数据库
drop database testdb;
为数据库设置Comment:
Comment on database testdb is 'test';
删除Comment:
Comment on database testdb is NULL;
修改数据库owner:
ALTER DATABASE testdb OWNER TO test;