Updated on 2025-02-27 GMT+08:00

PG_ROLES

PG_ROLES displays information about database roles. The initial user and users with the SYSADMIN or CREATEROLE attribute can view information about all roles. Other users can view only their own information.

Table 1 PG_ROLES columns

Name

Type

Reference

Description

rolname

name

N/A

Role name.

rolsuper

boolean

N/A

Specifies whether the role is the initial system administrator with the highest permissions.

  • t (true): yes.
  • f (false): no.

rolinherit

boolean

N/A

Specifies whether the role inherits the permissions for this type of roles.

  • t (true): yes.
  • f (false): no.

rolcreaterole

boolean

N/A

Specifies whether the role can create other roles.

  • t (true): yes.
  • f (false): no.

rolcreatedb

boolean

N/A

Specifies whether the role can create databases.

  • t (true): yes.
  • f (false): no.

rolcatupdate

boolean

N/A

Specifies whether the role can update system catalogs directly. Only the initial system administrator whose usesysid is set to 10 has this permission. This permission is unavailable for other users.

  • t (true): yes.
  • f (false): no.

rolcanlogin

boolean

N/A

Specifies whether the role can log in to the database.

  • t (true): yes.
  • f (false): no.

rolreplication

boolean

N/A

Specifies whether the role can be replicated.

  • t (true): yes.
  • f (false): no.

rolauditadmin

boolean

N/A

Specifies whether the role is an AUDITADMIN.

  • t (true): yes.
  • f (false): no.

rolsystemadmin

boolean

N/A

Specifies whether the role is a SYSADMIN.

  • t (true): yes.
  • f (false): no.

rolconnlimit

integer

N/A

Sets the maximum number of concurrent connections that this role can initiate if this role can log in. The value –1 indicates no limit.

rolpassword

text

N/A

Encrypted user password. The value is displayed as ********.

rolvalidbegin

timestamp with time zone

N/A

Start time for account validity (NULL if start time is not specified).

rolvaliduntil

timestamp with time zone

N/A

End time for account validity (NULL if end time is not specified).

rolparentid

oid

rolparentid in PG_AUTHID

OID of a group user to which the user belongs.

roltabspace

text

N/A

Storage space of the user permanent table, in KB.

rolconfig

text[]

setconfig in PG_DB_ROLE_SETTING

Default value of GUC items.

oid

oid

oid in PG_AUTHID

Role ID.

roluseft

boolean

roluseft in PG_AUTHID

Specifies whether the role can perform operations on foreign tables.

  • t (true): yes.
  • f (false): no.

rolkind

"char"

N/A

Role type.

  • n: common user, that is, non-permanent user.
  • p: permanent user.

nodegroup

name

N/A

Name of the node group associated with a role. If no node group is associated, leave it blank.

roltempspace

text

N/A

Storage space of the user temporary table, in KB.

rolspillspace

text

N/A

Operator disk spill space of the user, in KB.

rolmonitoradmin

boolean

N/A

Specifies whether the role is a MONADMIN.

  • t (true): yes.
  • f (false): no.

roloperatoradmin

boolean

N/A

Specifies whether the role is an O&M administrator.

  • t (true): yes.
  • f (false): no.

rolpolicyadmin

boolean

N/A

Specifies whether the role is a POLADMIN.

  • t (true): yes.
  • f (false): no.