Materialize Documentation
s
Join the Community github/materialize

CREATE ROLE

New in v0.7.0.

CREATE ROLE creates a new role.

Conceptual framework

A role is a user account in a Materialize instance.

When you connect to a Materialize instance, you must specify the name of a valid role in the system.

WARNING! Roles in Materialize are currently limited in functionality. In the future they will be used for role-based access control. See GitHub issue (#677) for details.

Syntax

CREATE ROLE role_name LOGIN NOLOGIN SUPERUSER NOSUPERUSER
Field Use
LOGIN Grants the user the ability to log in.
NOLOGIN Denies the user the ability to log in.
SUPERUSER Grants the user superuser permission, i.e., unrestricted access to the system.
NOSUPERUSER Denies the user superuser permission.
role_name A name for the role.

Details

Materialize only permits creating user accounts with both the LOGIN and SUPERUSER options specified.

You may not specify redundant or conflicting sets of options. For example, Materialize will reject the statement CREATE ROLE ... LOGIN NOLOGIN because the LOGIN and NOLOGIN options conflict.

Examples

CREATE ROLE rj LOGIN SUPERUSER;
SELECT name FROM mz_roles;
materialize
rj