Skip to navigationSkip to main contentSkip to footerScaleway Docs HomepageAsk our AI
Ask our AI

Advanced user permissions

Managed Database for PostgreSQL and MySQL lets you manage the permissions of your database users from the Scaleway console, API, and CLI. The user permissions API covers most use cases, but has some limitations.

This page explains why a user permission can switch to Custom, and how to choose between managed and non-managed logical databases depending on the Structured Query Language (SQL) commands you need.

Before you start

To complete the following actions, you must have:

Custom permissions

When you create a user or update their permissions, you choose one of the following permission types for each logical database:

  • None: No access to the database
  • Read: Allow users to read tables and fields in a database
  • Read/Write: Allow users to read/write content in databases
  • All: Allow users to create schemas and tables in addition to Read/Write rights

After you set the permissions, the database can change. For example, someone creates new tables or installs an extension. For security purposes, Scaleway does not apply the user permissions for that database to new objects. The user permission for that database switches to Custom - the user keeps the rights they had when you last updated their permissions, but has no rights on the new objects.

The permission also switches to Custom when you make it more granular per object. For example, you give a user the Read permission on a database, then grant them read/write rights on a single table of that database.

Tip

To switch a user permission from Custom back to a standard permission type that covers the whole database, including new objects, update the user permissions. For more information, see Set permissions for an existing user.

Managed and non-managed logical databases

You can create a logical database in the following ways:

  • From the Scaleway console, API, or CLI
  • By running an SQL query directly on your Database Instance

Each option has advantages and drawbacks:

Managed logical databaseNon-managed logical database
Creation methodScaleway console, API, or CLISQL query on the Database Instance
User permissions APISupported. See Set permissions for an existing user.Not supported. You manage permissions manually with SQL queries.
GRANT CONNECT and BYPASSRLS commandsNot allowedAllowed

On managed logical databases, you can get a result similar to GRANT CONNECT by giving the user the Read permission, then revoking the rights you do not need with a REVOKE statement.

BYPASSRLS is available on PostgreSQL only and lets a role bypass row-level security policies. For more information, see the PostgreSQL documentation about row security policies (External link).

Permissions for many databases and users

If your Database Instance has a large number of databases and users, the Scaleway console may have difficulty applying permission changes. For these use cases, use the Scaleway API (External link), the Scaleway CLI (External link), or Terraform (External link) instead.

Still need help?

Create a support ticket
No Results