CREATE ROLE#

Примечание

Ниже приведена оригинальная документация Trino. Скоро мы ее переведем на русский язык и дополним полезными примерами.

Синтаксис#

CREATE ROLE role_name
[ WITH ADMIN ( user | USER user | ROLE role | CURRENT_USER | CURRENT_ROLE ) ]
[ IN catalog ]

Описание#

CREATE ROLE creates the specified role.

The optional WITH ADMIN clause causes the role to be created with the specified user as a role admin. A role admin has permission to drop or grant a role. If the optional WITH ADMIN clause is not specified, the role is created with current user as admin.

The optional IN catalog clause creates the role in a catalog as opposed to a system role.

Примеры#

Create role admin

CREATE ROLE admin;

Create role moderator with admin bob:

CREATE ROLE moderator WITH ADMIN USER bob;

Limitations#

Some connectors do not support role management. See connector documentation for more details.

См. также#

DROP ROLE, SET ROLE, GRANT ROLES, REVOKE ROLES