pg_group

A system view providing the names and members of all roles which cannot log in

pg_group is a system catalogue view providing the names and members of all roles that are marked as not rolcanlogin.

pg_group was created for backwards compatibility in PostgreSQL 8.1 when the former pg_group table was replaced by pg_auth_members).

Definition by PostgreSQL version

pg_group (PostgreSQL 15)

            View "pg_catalog.pg_group"
  Column  | Type  | Collation | Nullable | Default 
----------+-------+-----------+----------+---------
 groname  | name  |           |          | 
 grosysid | oid   |           |          | 
 grolist  | oid[] |           |          |
    

Documentation: pg_group

pg_group (PostgreSQL 14)

            View "pg_catalog.pg_group"
  Column  | Type  | Collation | Nullable | Default 
----------+-------+-----------+----------+---------
 groname  | name  |           |          | 
 grosysid | oid   |           |          | 
 grolist  | oid[] |           |          |
    

Documentation: pg_group

pg_group (PostgreSQL 13)

            View "pg_catalog.pg_group"
  Column  | Type  | Collation | Nullable | Default 
----------+-------+-----------+----------+---------
 groname  | name  |           |          | 
 grosysid | oid   |           |          | 
 grolist  | oid[] |           |          |
    

Documentation: pg_group

pg_group (PostgreSQL 12)

            View "pg_catalog.pg_group"
  Column  | Type  | Collation | Nullable | Default 
----------+-------+-----------+----------+---------
 groname  | name  |           |          | 
 grosysid | oid   |           |          | 
 grolist  | oid[] |           |          |
    

Documentation: pg_group

pg_group (PostgreSQL 11)

            View "pg_catalog.pg_group"
  Column  | Type  | Collation | Nullable | Default 
----------+-------+-----------+----------+---------
 groname  | name  |           |          | 
 grosysid | oid   |           |          | 
 grolist  | oid[] |           |          |
    

Documentation: pg_group

pg_group (PostgreSQL 10)

            View "pg_catalog.pg_group"
  Column  | Type  | Collation | Nullable | Default 
----------+-------+-----------+----------+---------
 groname  | name  |           |          | 
 grosysid | oid   |           |          | 
 grolist  | oid[] |           |          |
    

Documentation: pg_group

pg_group (PostgreSQL 9.6)

  View "pg_catalog.pg_group"
  Column  | Type  | Modifiers 
----------+-------+-----------
 groname  | name  | 
 grosysid | oid   | 
 grolist  | oid[] |
    

Documentation: pg_group

pg_group (PostgreSQL 9.5)

  View "pg_catalog.pg_group"
  Column  | Type  | Modifiers 
----------+-------+-----------
 groname  | name  | 
 grosysid | oid   | 
 grolist  | oid[] |
    

Documentation: pg_group

pg_group (PostgreSQL 9.4)

  View "pg_catalog.pg_group"
  Column  | Type  | Modifiers 
----------+-------+-----------
 groname  | name  | 
 grosysid | oid   | 
 grolist  | oid[] |
    

Documentation: pg_group

pg_group (PostgreSQL 9.3)

  View "pg_catalog.pg_group"
  Column  | Type  | Modifiers 
----------+-------+-----------
 groname  | name  | 
 grosysid | oid   | 
 grolist  | oid[] |
    

Documentation: pg_group

pg_group (PostgreSQL 9.2)

  View "pg_catalog.pg_group"
  Column  | Type  | Modifiers 
----------+-------+-----------
 groname  | name  | 
 grosysid | oid   | 
 grolist  | oid[] |
    

Documentation: pg_group

pg_group (PostgreSQL 9.1)

  View "pg_catalog.pg_group"
  Column  | Type  | Modifiers 
----------+-------+-----------
 groname  | name  | 
 grosysid | oid   | 
 grolist  | oid[] |
    

Documentation: pg_group

pg_group (PostgreSQL 9.0)

  View "pg_catalog.pg_group"
  Column  | Type  | Modifiers 
----------+-------+-----------
 groname  | name  | 
 grosysid | oid   | 
 grolist  | oid[] |
    

Documentation: 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;
    

Documentation: 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;
    

Documentation: 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;
    

Documentation: pg_group

Change history

This view has not been modified since it was added in PostgreSQL 8.1.

Examples

Sample contents of pg_group on PostgreSQL 15, with no additional roles defined:

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)

Categories

System catalogue, Users and roles

See also

pg_shadow, pg_auth_members