Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Managed Service for Greenplum®
  • Getting started
    • All guides
    • Connecting to a database
      • 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

Managing roles and users

Written by
Yandex Cloud
Updated at May 13, 2024
  • 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 with the Managed Service for Greenplum® cluster and is automatically given the mdb_admin 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> <list_of_attributes>;

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 <comma-separated_list_of_roles>;

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 <comma-separated_list_of_roles>;

Change role attributesChange role attributes

SQL

Run this command:

ALTER ROLE <role_name> <list_of_attributes>;

For a list of available attributes, see Attributes.

Configure role privilegesConfigure role privileges

SQL

To grant privileges to a role, run the command:

GRANT <comma-separated_list_of_privileges> ON <object_name> TO <role_name>;

For a list of available privileges, see Privileges.

To revoke privileges from a role, run the command:

REVOKE <comma-separated_list_of_privileges> ON <object_name> FROM <role_name>;

Instead of listing all object privileges, use ALL PRIVILEGES.

To revoke all privileges of all role 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.
  • Option 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 VMware, Inc. in the United States and/or other countries.

Was the article helpful?

Previous
Connecting to a database
Next
Managing resource groups
Yandex project
© 2025 Yandex.Cloud LLC