highgo=# \db --列举出所有的表空间
List of tablespaces
Name | Owner | Location
------------+--------+----------
pg_default | highgo |
pg_global | highgo |
(2 rows)
highgo=# \dn ----列举出所有的schema
List of schemas
Name | Owner
----------------+--------
hgdb_catalog | highgo
oracle_catalog | highgo
public | highgo
(3 rows)
highgo=# \du 列举出所有的角色或用户
Lis
List of tablespaces
Name | Owner | Location
------------+--------+----------
pg_default | highgo |
pg_global | highgo |
(2 rows)
highgo=# \dn ----列举出所有的schema
List of schemas
Name | Owner
----------------+--------
hgdb_catalog | highgo
oracle_catalog | highgo
public | highgo
(3 rows)
highgo=# \du 列举出所有的角色或用户
Lis

本文展示了如何使用PostgreSQL的命令行工具查询数据库中的表空间、所有schema以及用户角色。通过`db`列出表空间,`dn`列出schema,`du`列出用户角色,并演示了创建新角色和schema的过程。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



