Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex MPP Analytics for PostgreSQL
  • Getting started
    • All guides
      • Role and user management
      • Managing resource groups
      • User authentication rules
      • Monitoring and managing sessions and queries in the Command Center
      • Managing client processes and user sessions
    • Connecting to an external file server (gpfdist)
    • Auxiliary utilities
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • View a list of roles
  • Create a role
  • Configure group roles
  • Change role attributes
  • Configure role privileges
  • Delete a role
  • Examples
  • Creating a role
  1. Step-by-step guides
  2. Users and sessions
  3. Role and user management

Role and user management

Written by
Yandex Cloud
Updated at May 22, 2025
  • View a list of roles
  • Create a role
  • Configure group roles
  • Change role attributes
  • Configure role privileges
  • Delete a role
  • Examples
    • Creating a role

Greenplum® manages database access rights using two types of roles:

  • User: Role that can log in to the database.
  • Group: Role that includes other roles.
    ​
    ​For more information, see Users and roles.

The admin user is created together with the Yandex MPP Analytics for PostgreSQL cluster and automatically gets the mdb_admin role. Connect to the database on its behalf to:

  • View a list of roles.
  • Create a role.
  • Configure group roles.
  • Change role attributes.
  • Configure role privileges.
  • Delete a role.

For more information about role interaction commands, see the Greenplum® documentation.

View a list of rolesView a list of roles

SQL

Run this command:

SELECT rolname FROM pg_roles;

To see a list of roles with their privileges, run the command:

SELECT
    rolname,
    rolsuper,
    rolcreatedb,
    rolcreaterole,
    rolinherit,
    rolcanlogin,
    rolconnlimit,
    rolcreaterextgpfd
FROM pg_roles;

Result:

    rolname     | rolsuper | rolcreatedb | rolcreaterole | rolinherit | rolcanlogin | rolconnlimit | rolcreaterextgpfd
----------------+----------+-------------+---------------+------------+-------------+--------------+-------------------
 mdb_admin      | f        | f           | f             | t          | f           |           -1 | f
 gpadmin        | t        | t           | t             | t          | t           |           -1 | t
 monitor        | t        | f           | f             | t          | t           |           -1 | f
 user1          | f        | t           | t             | t          | t           |           -1 | t

Where:

  • t: Privilege is available.
  • f: No privilege.

Create a roleCreate a role

SQL

Run this command:

CREATE ROLE <role_name> <attribute_list>;

For a list of available attributes, see Attributes.

Configure group rolesConfigure group roles

SQL

To add a role to a group role, run the command:

GRANT <group_role_name> TO <list_of_roles_separated_by_commas>;

You can obtain role names with a list of roles in the cluster.

The LOGIN, SUPERUSER, CREATEDB, CREATEROLE, CREATEEXTTABLE, and RESOURCE QUEUE attributes are not inherited. To use all attributes of the group role, run the following command on behalf of the role:

SET ROLE <group_role_name>;

To remove a role from a group role, run the command:

REVOKE <group_role_name> FROM <list_of_roles_separated_by_commas>;

Change role attributesChange role attributes

SQL

Run this command:

ALTER ROLE <role_name> <attribute_list>;

For a list of available attributes, see Attributes.

Configure role privilegesConfigure role privileges

SQL

To grant privileges to a role, run the command:

GRANT <list_of_privileges_separated_by_commas> ON <object_name> TO <role_name>;

For a list of available privileges, see Privileges.

To revoke privileges from a role, run the command:

REVOKE <list_of_privileges_separated_by_commas> ON <object_name> FROM <role_name>;

Instead of listing all the object's privileges, use ALL PRIVILEGES.

To revoke all privileges of all the role's objects, run the command:

DROP OWNED BY <role_name>;

Delete a roleDelete a role

Before deleting a role, delete all objects it owns or reassign their ownership rights and revoke all privileges for other objects.

SQL

Run this command:

DROP ROLE <role_name>;

ExamplesExamples

Creating a roleCreating a role

Create a role with these test characteristics:

  • Name: greenplum_user.
  • Attributes: CREATEDB and CREATEROLE.
  • Capable of logging in to the system using a secure password: password123.

Run this command:

CREATE ROLE greenplum_user CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'password123';

Check that the new role with the specified attributes appeared in the list:

SELECT
    rolname,
    rolsuper,
    rolcreatedb,
    rolcreaterole,
    rolinherit,
    rolcanlogin,
    rolconnlimit,
    rolcreaterextgpfd
FROM pg_roles;

Greenplum® and Greenplum Database® are registered trademarks or trademarks of Broadcom Inc. in the United States and/or other countries.

Was the article helpful?

Previous
Queries in Yandex WebSQL
Next
Managing resource groups
© 2025 Direct Cursus Technology L.L.C.