Updated on 2024-06-03 GMT+08:00

PG_ROLES

PG_ROLES displays information about database roles. Initial users 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 a 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 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 audit administrator.

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

rolsystemadmin

Boolean

N/A

Specifies whether the role is a system administrator.

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

rolconnlimit

integer

N/A

Maximum number of concurrent connections that a 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 the start time is not specified).

rolvaliduntil

timestamp with time zone

N/A

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

rolrespool

name

N/A

Resource pool that a user can use

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.

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 monitor administrator.

  • 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 security policy administrator.

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