Skip to main content
Version: 2.0.0 (latest)

3.27. Roles

PostgreSQL implements part of its access control using roles. These entities can own a set of privileges over the database objects and can be configured as a single user or a group of users. One particularity for roles is that, unlike the majority of objects, they are created at the database cluster level. In other words, a role is not associated with a specific database but with the server as a whole.

ch3.role-dialog.attributes12345678910

Attributes
#FieldGroup boxDescription
1Password

Defines a password for the role. It is used in password authentication, so it is meaningful for roles that can log in (Can login checked).

2Connections

Specifies the number of concurrent connections the role can open. This attribute is used only if the role can log in to the server. The value -1 creates a role without connection limit.

3SuperuserOptions

Indicates that the role has full control over the server (SUPERUSER).

4Inherit permissionsOptions

Indicates that the role will inherit the privileges of the roles listed in the Member of tab (INHERIT).

5Bypass RLSOptions

Indicates that the role bypasses any row-level security on tables (BYPASSRLS).

6Can create databaseOptions

Indicates that the role has permission to create databases (CREATEDB).

7Can create roleOptions

Indicates that the role can create other roles on the server (CREATEROLE).

8Can loginOptions

Indicates that the role can log in to the server (LOGIN).

9Can use replicationOptions

Indicates that the role can control the replication feature on the server (REPLICATION).

10ValidityOptions

Specifies the date and time after which the role's password is no longer valid (VALID UNTIL). By default, a role never expires: unchecking this option creates a role without expiration date.

ch3.role-dialog.members1

Members
#FieldDescription
1Members

The roles that are added as members of the role being handled (ROLE). Use the buttons beside the list to include or remove them.

ch3.role-dialog.admin-option1

Admin option
#FieldDescription
1Admin option

The roles that are added as members of the role being handled with ADMIN OPTION (ADMIN), which permits them to grant membership in it to other roles.

ch3.role-dialog.member-of1

Member of
#FieldDescription
1Member of

The roles of which the role being handled is a member (IN ROLE). The role is added as a member of each one of the listed roles.

References​

Role DDL
https://www.postgresql.org/docs/current/static/sql-createrole.html