Postgresql中用户和组之间的区别 [英] Distinctions between users and groups in postgresql

查看:371
本文介绍了Postgresql中用户和组之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自是postgres PostgreSQL的默认特殊用户?


PostgreSQL中的用户与可以登录的角色相同。通常,
nologin角色用作组,但这不是必需的。

a user in PostgreSQL is the same as a role that can login. Normally nologin roles are used as groups, but that is not a requirement.

使自己摆脱用户和组的概念。某些角色可以
登录。角色可以是其他角色的成员。

Free yourself from the concept of users and groups. Some roles can login. Roles can be members of other roles.

基本上,用户和组的概念合并到角色中。但是在我看来,仍然存在区别。

Basically, concepts of user and group are merged into role. But it seems to me there are still distinctions.

nologin角色用作组,但这不是必需的。
这是否意味着

"nologin roles are used as groups, but that is not a requirement." Does that mean


  • 非登录角色可能仍然是用户而不是组?

  • a nonlogin role may still be a user not a group?

登录角色可以是一个组吗?

a login roles can be a group?

角色可以成为其他角色的成员,是否表示

"Roles can be members of other roles", does that mean


  • 一个组可以是另一个角色的成员,并且另一个角色可以是用户吗?

  • a group can be a member of another role, and can the other role be a user?

角色可以是用户的成员,并且该角色可以是组吗?

a role can be a member of a user, and can that role be a group?

谢谢。

推荐答案

唯一的区别是尊重登录

引用下面的doc


CREATE USER现在是CREATE ROLE的别名。唯一的区别是,将命令拼写为CREATE USER时,默认情况下假定为LOGIN,而将命令拼写为CREATE ROLE时则假定为NOLOGIN。

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.

通常,没有单独的用户/组概念。只有角色。角色可以是其他角色的成员。而且角色还可以具有一组属性,例如 SUPERUSER, CREATEDB等,而 LOGIN恰好是其中的一个。

In general, there's no separate concept of user/group. There are only roles. And a role can be a member of other roles. And a role can also have a set of attributes like "SUPERUSER", "CREATEDB" etc., and "LOGIN" happens to be just one of them.

这篇关于Postgresql中用户和组之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆