文档

CREATE USER

更新时间:

CREATE USER现在是CREATE ROLE的一个别名。

简介

CREATE USER现在是CREATE ROLE的一个别名。唯一的区别是 CREATE USERLOGIN 被作为默认值,而NOLOGINCREATE ROLE的默认值。

语法

    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