CREATE USER
CREATE USER
默认情况下,使用LOGIN特权定义一个新的数据库角色。
概要
CREATE USER name [[WITH] option [ ... ]]
其中option可以是:
SUPERUSER | NOSUPERUSER | CREATEDB | NOCREATEDB | CREATEROLE | NOCREATEROLE | CREATEUSER | NOCREATEUSER | CREATEEXTTABLE | NOCREATEEXTTABLE [ ( attribute='value'[, ...] ) ] where attributes and value are: type='readable'|'writable' protocol='gpfdist'|'http' | INHERIT | NOINHERIT | LOGIN | NOLOGIN | REPLICATION | NOREPLICATION | CONNECTION LIMIT connlimit | [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password' | VALID UNTIL 'timestamp' | IN ROLE role_name [, ...] | IN GROUP role_name | ROLE role_name [, ...] | ADMIN role_name [, ...] | USER role_name [, ...] | SYSID uid | RESOURCE QUEUE queue_name | RESOURCE GROUP group_name | [ DENY deny_point ] | [ DENY BETWEEN deny_point AND deny_point]
描述
CREATE USER是CREATE ROLE的别名。
CREATE ROLE和CREATE USER之间的唯一区别是CREATE USER默认情况下假定LOGIN, 而CREATE ROLE默认情况下假定NOLOGIN。
兼容性
SQL标准中没有CREATE USER语句。