Skip to main content

Manage Postgres roles

Preview

This feature is in Public Preview in the following regions: us-east-1, us-west-2, eu-west-1, ap-southeast-1, ap-southeast-2, eu-central-1, us-east-2, ap-south-1.

Lakebase Provisioned uses provisioned compute that you manually scale. For feature comparison with the new Lakebase Autoscaling, see choosing between versions.

A Postgres role for the Lakebase database instance owner’s Databricks identity is created automatically.

Initially, only the owner of the instance can log in and access the instance through Postgres. To allow other Databricks identities to log in to the database instance, the Databricks identity must have a corresponding Postgres role.

This page describes how to add and manage additional Databricks identity-based roles in PostgreSQL.

Create Postgres roles and grant privileges for Databricks identities

Create Postgres roles using the Databricks UI or PostgreSQL queries.

note

Role management actions are governed by the permissions granted on the database instance. Ensure you have the appropriate level of access before attempting to manage roles.

Users with CAN USE permission on the database instance can view the existing Postgres roles associated with Databricks identities or add a role for their own identity to the instance.

Users with CAN MANAGE can additionally create roles for other Databricks identities, including with additional privileges, and drop roles for any Databricks identity.

You can assign additional permissions to any desired users, groups, or service principals in the Database instances overview page.

  1. Click App icon. Apps in the top right corner and select Lakebase Postgres.
  2. Click Provisioned to open the Provisioned instances page.
  3. Select your database instance.
  4. Select the Roles page in the Lakebase App sidebar.
  5. Click Add role in the top right corner.
  6. From the Principal drop-down menu, select a user, group, or service principal that you want to grant database access. You must select a Databricks identity that doesn't already have a Postgres role in the instance.
  7. (Optional) Select System Roles to grant:
    • databricks_superuser: Grants read and write access to all data. This is an administrative role with broad privileges that inherits from pg_read_all_data, pg_write_all_data, and pg_monitor. See Pre-created roles and permissions.
  8. (Optional) Select System Attributes to grant specific capabilities:
    • CREATEDB: Grants permission to create new databases.
    • CREATEROLE: Grants permission to create new roles.
    • BYPASSRLS: Grants permission to bypass row-level security (RLS) policies.
  9. Click Add.

View Databricks identity roles

You can see which users, groups, and service principals has a corresponding Postgres role in the Database instances overview page.

  1. Click App icon. Apps in the top right corner and select Lakebase Postgres.
  2. Click Provisioned to open the Provisioned instances page.
  3. Select your database instance.
  4. Select the Roles page in the Lakebase App sidebar.

Drop a Databricks identity-based Postgres role

Dropping a role cannot be undone. You can recreate a role, but any object ownership reassignment is non-reversible without dropping the new role that owns reassigned objects.

  1. Click App icon. Apps in the top right corner and select Lakebase Postgres.
  2. Click Provisioned to open the Provisioned instances page.
  3. Select your database instance.
  4. Select the Roles page in the Lakebase App sidebar.
  5. For the role you want to drop, click Kebab menu icon. on the right side of the row.
  6. Click Drop.
  7. (Optional) If the role owns objects, turn on Reassign owned objects to enable dropping the role. This option reassigns owned objects to another role before dropping. Some objects (such as grants to the role being dropped) aren't reassignable and are dropped after reassignment of all reassignable objects.
  8. Click Confirm.