CREATE USER
CREATE USER - 定义新的数据库角色
语法格式
CREATE USER name [ [ WITH ] option [ ... ] ]
这里 option 可以是:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT connlimit
| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
说明
CREATE USER 现在是 CREATE ROLE的别名。唯一的区别是当命令拼写为CREATE USER 时,默认情况下假定为 LOGIN ,而当命令拼写为 CREATE ROLE时则假定为 NOLOGIN 。