如何查看postgresql数据库用户
1个回答
展开全部
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
mqis | Password valid until infinity | {}
mqis_app | Password valid until infinity | {}
postgres | Superuser, Create role, Create DB, Replication | {}
postgres=# SELECT u.usename AS "User name",
u.usesysid AS "User ID",
CASE WHEN u.usesuper AND u.usecreatedb THEN CAST('superuser, create
database' AS pg_catalog.text)
WHEN u.usesuper THEN CAST('superuser' AS pg_catalog.text)
WHEN u.usecreatedb THEN CAST('create database' AS
pg_catalog.text)
ELSE CAST('' AS pg_catalog.text)
END AS "Attributes"
FROM pg_catalog.pg_user u
ORDER BY 1;
-------------------------------------------------
User name | User ID | Attributes
-----------+---------+-------------------
mqis | 16393 |
mqis_app | 16397 |
postgres | 10 | superuser, create+
| | database
(3 rows)
postgres=#
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
mqis | Password valid until infinity | {}
mqis_app | Password valid until infinity | {}
postgres | Superuser, Create role, Create DB, Replication | {}
postgres=# SELECT u.usename AS "User name",
u.usesysid AS "User ID",
CASE WHEN u.usesuper AND u.usecreatedb THEN CAST('superuser, create
database' AS pg_catalog.text)
WHEN u.usesuper THEN CAST('superuser' AS pg_catalog.text)
WHEN u.usecreatedb THEN CAST('create database' AS
pg_catalog.text)
ELSE CAST('' AS pg_catalog.text)
END AS "Attributes"
FROM pg_catalog.pg_user u
ORDER BY 1;
-------------------------------------------------
User name | User ID | Attributes
-----------+---------+-------------------
mqis | 16393 |
mqis_app | 16397 |
postgres | 10 | superuser, create+
| | database
(3 rows)
postgres=#
七鑫易维信息技术
2024-09-02 广告
2024-09-02 广告
Play Video 七鑫易维是致力于机器视觉和人工智能领域的高新科技企业,迄今已专注眼球追踪技术的研发、创新与应用超过14年,拥有完全自主知识产权,全球专利总量655余项。 作为眼球追踪技术领域的全球知名品牌,七鑫易维的产品体系覆盖眼动分...
点击进入详情页
本回答由七鑫易维信息技术提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |