Do not routinely work with the cluster as the bootstrap user. Create other users with the necessary privileges and leave the bootstrap user as a fallback in case of emergency.
Bootstrap user privileges
The bootstrap user is not a superuser but has administrative privileges. It has themsp_admin and msp_superuser roles defined in Managed Service for PostgreSQL.
-
msp_admingives the following privileges:pg_monitorandpg_signal_backendpredefined roles.- Subscription for logical replication (
CREATE | DROP | ALTER SUBSCRIPTION). - Ability to enable extensions (
CREATE EXTENSION). - Extension-specific functions:
pg_stat_reset()andpg_stat_statements_reset()from the pg_stat_statements extension.
-
msp_superuserenables you to bypass ownership verification when you grant and revoke privileges.
msp_admin role but not the msp_superuser role.
Prerequisites
To create or delete database users, connect to the cluster viapsql as a user with administrative privileges.
If you use the web console to change the bootstrap user password, you don’t need to complete any additional prerequisites.
If you use the CLI, Terraform or an SDK to change the bootstrap user password, install and configure one of the following tools:
- CLI
- Terraform
- Go SDK
- Python SDK
- JavaScript SDK
Install and configure the Nebius AI Cloud CLI.
How to manage users
Create a new user
- Connect to the cluster via psql as a user with administrative privileges (for example, the bootstrap user).
-
Create a new user with privileges to connect to a
<test_db>database. Execute the following SQL statements:<db_user>can connect to the<test_db>database and work with the data. The following usernames are reserved, do not specify them:admin,repl,monitor,postgres,publicandnone. -
(Optional) If you need to grant them additional privileges for the database:
-
Connect to the cluster as the user that owns the
<test_db>database. Usually, the database owner is the user who created it. Alternatively, connect as the bootstrap user to bypass the database ownership check. -
Execute the following SQL statement:
-
Connect to the cluster as the user that owns the
Create a new user with administrative privileges
To create a user with administrative privileges, connect as the bootstrap user and execute the following SQL statements:<new_admin> can create databases, create users, and grant them privileges. The msp_admin role lets them bypass checks when interacting with data.
You cannot grant the msp_superuser role. You can grant any predefined roles except for the following:
role_pg_read_server_filesrole_pg_write_server_filesrole_pg_execute_server_programrole_pg_read_all_datarole_pg_write_all_data
admin, repl, monitor, postgres, public and none.
Manage the bootstrap user
To change the password of the bootstrap user:- Web console
- CLI
- Terraform
- Go SDK
- Python SDK
- JavaScript SDK
- In the sidebar, go to PostgreSQL.
- Click your cluster and go to Settings.
- In the Database section, enter the new password.
- Click Update cluster.
Delete a user
To delete a user, connect to the cluster as a user with administrative privileges and execute the following SQL statement:Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.