pg_group
是一个提供所有标记为不 rolcanlogin
的角色的名称和成员的系统目录视图。
pg_group
是为了在 PostgreSQL 8.1 中向后兼容而创建的,当时之前的 pg_group 表被 pg_auth_members 替换。
按 PostgreSQL 版本定义
pg_group (PostgreSQL 17)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 16)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 15)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 14)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 13)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 12)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 11)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 10)
View "pg_catalog.pg_group" Column | Type | Collation | Nullable | Default ----------+-------+-----------+----------+--------- groname | name | | | grosysid | oid | | | grolist | oid[] | | |
文档: pg_group
pg_group (PostgreSQL 9.6)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] |
文档: pg_group
pg_group (PostgreSQL 9.5)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] |
文档: pg_group
pg_group (PostgreSQL 9.4)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] |
文档: pg_group
pg_group (PostgreSQL 9.3)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] |
文档: pg_group
pg_group (PostgreSQL 9.2)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] |
文档: pg_group
pg_group (PostgreSQL 9.1)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] |
文档: pg_group
pg_group (PostgreSQL 9.0)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] |
文档: pg_group
pg_group (PostgreSQL 8.4)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] | View definition: SELECT pg_authid.rolname AS groname, pg_authid.oid AS grosysid, ARRAY( SELECT pg_auth_members.member FROM pg_auth_members WHERE pg_auth_members.roleid = pg_authid.oid) AS grolist FROM pg_authid WHERE NOT pg_authid.rolcanlogin;
文档: pg_group
pg_group (PostgreSQL 8.3)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] | View definition: SELECT pg_authid.rolname AS groname, pg_authid.oid AS grosysid, ARRAY( SELECT pg_auth_members.member FROM pg_auth_members WHERE pg_auth_members.roleid = pg_authid.oid) AS grolist FROM pg_authid WHERE NOT pg_authid.rolcanlogin;
文档: pg_group
pg_group (PostgreSQL 8.2)
View "pg_catalog.pg_group" Column | Type | Modifiers ----------+-------+----------- groname | name | grosysid | oid | grolist | oid[] | View definition: SELECT pg_authid.rolname AS groname, pg_authid.oid AS grosysid, ARRAY( SELECT pg_auth_members.member FROM pg_auth_members WHERE pg_auth_members.roleid = pg_authid.oid) AS grolist FROM pg_authid WHERE NOT pg_authid.rolcanlogin;
文档: pg_group
更改历史记录
自 PostgreSQL 8.1 中添加以来,此视图未被修改。
- PostgreSQL 8.1
- 添加 (提交 7762619e)
示例
在 PostgreSQL 15 上没有定义额外角色的 pg_group
的示例内容
postgres=# SELECT * FROM pg_group ; groname | grosysid | grolist ---------------------------+----------+--------- pg_database_owner | 6171 | {} pg_read_all_data | 6181 | {} pg_write_all_data | 6182 | {} pg_monitor | 3373 | {} pg_read_all_settings | 3374 | {3373} pg_read_all_stats | 3375 | {3373} pg_stat_scan_tables | 3377 | {3373} pg_read_server_files | 4569 | {} pg_write_server_files | 4570 | {} pg_execute_server_program | 4571 | {} pg_signal_backend | 4200 | {} pg_checkpointer | 4544 | {} (12 rows)
参考
- PostgreSQL 文档: pg_group