This will output all users, including their login username, roles, and whether they have administrative rights. List all PostgreSQL Roles List all roles in PostgreSQL with the following command: \dg This will output a list of all roles, including the name of the role and the names of the u...
List of roles Role name | Attributes | Member of ---+---+--- postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} ubuntu | | {} postgres=# \du+; List of roles Role name | Attributes | Member of | Description ---+---+---...
postgres=#CREATEROLEadminCREATEDBCREATEROLE;CREATEROLEpostgres=#\duListofrolesRolename|Attributes|Memberof---+---+---admin|Createrole,CreateDB,Cannotlogin|{}postgres|Superuser,Createrole,CreateDB,Replication,BypassRLS|{}tony|Passwordvaliduntil2020-01-0100:00:00-05|{} 在实践中,最好创建一个拥有 CRE...
List of roles Role name | Attributes | Member of ---+---+--- david | | {} postgres | Superuser, Create role, Create DB, Replication | {} sandy | | {} postgres=# SELECT rolname from pg_roles ; rolname --- postgres sandy david (3 rows) postgres=# SELECT usename from pg_use...
List of roles Role name | Attributes | Member of ---+---+--- david | Cannot login | {} postgres | Superuser, Create role, Create DB, Replication | {} sandy | | {} postgres=# postgres=# SELECT rolname from pg_roles ; rolname --- postgres...
List of roles Role name | Attributes | Member of ---+---+--- lss | Superuser, Create role, Create DB, Replication, Bypass RLS | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} 修改用户密码 postgres=# ALTER ROLE...
postgres=# \du List of rolesRole name | Attributes | Member of---+---+---dev1 |
test-# \dgList of rolesRole name | Attributes | Member of---+---+---pg1 | Superuser, Create role, Create DB, Replication, Bypass RLS | {}postgres | Superuser | {}postgres_exporter | | {}postgres_exporter1 | | {}zsk | | {}test-# \dg+List of rolesRole name | Attributes |...
List of roles Role name | Attributes | Member of ---+---+--- lss | | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} 授权 postgres=# alter role lss Createrole CREATEDB; ALTER ROLE postgres=# \du List of roles Role name | Attributes...
GRANT ALL ON employees TO examplerole; 3. 使用退出数据库\q。 列出所有角色 您可以通过运行列出Postgres Shell中的所有角色\du。您将看到类似于此的输出: 代码语言:txt AI代码解释 postgres=# \du List of roles Role name | Attributes | Member of ...