pgsql之create user与create role的区别
生活随笔
收集整理的這篇文章主要介紹了
pgsql之create user与create role的区别
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
create user的語法
CREATE USER name [ [ WITH ] option [ ... ] ]where option can be:SUPERUSER | NOSUPERUSER| CREATEDB | NOCREATEDB| CREATEROLE | NOCREATEROLE| CREATEUSER | NOCREATEUSER| INHERIT | NOINHERIT| LOGIN | NOLOGIN| REPLICATION | NOREPLICATION| BYPASSRLS | NOBYPASSRLS| 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例如:create user test with replication createrole createdb login password 'test123';
with 后面的部分描述的是“系統(tǒng)權(quán)限”或者數(shù)據(jù)庫(kù)用戶的屬性。使用\du命令查看,則對(duì)應(yīng)著List of roles Attributes列。如圖:
create user與create role的區(qū)別
官網(wǎng)上的描述是:
CREATE USER?is now an alias for?CREATE ROLE. The only difference is that when the command is spelled?CREATE USER,?LOGIN?is assumed by default, whereas?NOLOGIN?is assumed when the command is spelled?CREATE ROLE.
也就是說create user 默認(rèn)有l(wèi)ogin權(quán)限,而create role沒有。
?
總結(jié)
以上是生活随笔為你收集整理的pgsql之create user与create role的区别的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: userToken
- 下一篇: Kinect开发笔记之一Kinect详细