User management
This article describes Postgres user and role management within Crunchy Bridge.
Each Postgres instance provisioned within Crunchy Bridge will by default receive at least 3 Postgres roles.
Postgres role - This is your Postgres super user account. Administrators within the team have access to this role. It is not recommended to connect to your application with this role. Intended use of the Postgres role is for administrative functionality of users and permissions of your database. The Postgres user can enable new extensions. By default auditing with pgaudit is enabled for the Postgres role.
Application role - This is a role created that is intended to be connect to your application. Administrators and managers within the team have access to this role. This role has standard permissions to create/modify/destroy tables, insert data, and perform most general operations against your database. By default auditing of the commands run by this role within your Postgres database are disabled.
Individual user roles - On Crunchy Bridge, all members of a team receive a unique user credential to connect to their Crunchy Bridge database. Default permissions for the user role is defined by the "Default database role access" in the Team Settings. This is set when a team is initially created and can be modified by a team administrator:
To change permissions on existing roles, use the Roles Settings page for the cluster. From the cluster, open Settings in the lefthand sidebar and select Roles. Role permissions, including read and write access, should be changed there rather than with SQL.
Info
Crunchy Bridge is the source of truth for managed roles and their credentials. Each time a managed role is modified from the dashboard, or its credentials are retrieved from the dashboard, Crunchy Bridge resynchronizes it to its platform-defined state. Permission or credential changes made to a managed role outside of the dashboard are overwritten during that resynchronization and can be reverted unexpectedly.
We recommend letting Crunchy Bridge manage these roles, including password rotation and read/write permissions. If you need a role with credentials that Crunchy Bridge does not store, create a custom role with CREATE ROLE. Crunchy Bridge does not modify custom roles.
User roles naming
The cluster Settings page has a Roles tab where you can see the roles in use. Each individual user created will have a role name that is a unique character string starting with u_. This user role is what you'll need to use if you happen to be searching logs for a user's audit information.
For more information, check out the documentation on Team management.