RefLib

Reference library for AI

Back

postgresql_16:7.1.76.1 Description

PostgreSQL 16 > Reference > SQL Commands > CREATE ROLE > Description

CREATE ROLE adds a new role to a PostgreSQL database cluster. A role is an entity that can own database objects and have database privileges; a role can be considered a “user”, a “group”, or both depending on how it is used. Refer to (see postgresql_16:4.7) and (see postgresql_16:4.6) for information about managing users and authentication. You must have CREATEROLE privilege or be a database superuser to use this command.

Note that roles are defined at the database cluster level, and so are valid in all databases in the cluster.

During role creation it is possible to immediately assign the newly created role to be a member of an existing role, and also assign existing roles to be members of the newly created role. The rules for which initial role membership options are enabled are described below in the IN ROLE, ROLE, and ADMIN clauses. The (see postgresql_16:7.1.148) command has fine-grained option control during membership creation, and the ability to modify these options after the new role is created.

Back