Users & Roles
Create and edit PostgreSQL roles, their attributes, memberships and table access, with a preview of the exact SQL.
The Users & Roles window lets you manage PostgreSQL roles without writing CREATE ROLE and GRANT statements by hand. Every change is shown as SQL before it runs and is applied in a single transaction.
Requirements
- PostgreSQL 10 or later only.
- To create or edit roles, you need the CREATEROLE attribute or superuser.
Users & Roles isn't available for MySQL / MariaDB, SQL Server, SQLite, CockroachDB or Redshift.
Open Users & Roles
Choose View ▸ Users & Roles (⌥⌘U). The window opens for the current connection and remembers its size and position.
Role list
The list on the left shows every role:
- Icons tell login roles apart from group roles.
- Badges mark super (superuser) and you (the role you're connected as).
- Type in Filter roles to narrow the list.
- Tick System to show the predefined
pg_roles (hidden by default). - Use + to create a new role, − to drop the selected one, and the refresh button to reload.
Role fields
| Field | Description |
|---|---|
| Name | The role name. |
| Password | Optional. When editing, leave it empty to keep the current password, or tick Remove to clear it. |
| Connection limit | Leave empty for Unlimited. |
| Valid until | Leave empty for Never, or enter a date such as 2027-01-01. |
| Comment | A comment stored on the role. |
Attributes
- Can log in
- Superuser
- Create databases
- Create roles
- Inherit privileges
- Replication
- Bypass row security
- Read-only transactions — sets
default_transaction_read_onlyfor the role.
New roles start with Can log in, Read-only transactions and Read only table access, so a new user can't change data until you allow it.
Table access
Grant access to the tables of a schema in one step:
- Pick the Schema.
- Choose a preset:
| Preset | Effect |
|---|---|
| Leave as is | Don't change existing grants. |
| No access | Revoke table privileges. |
| Read only | SELECT. |
| Read & write | Read and write privileges. |
| Custom | Pick from SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES and TRIGGER. |
Also tables created later (by <you>) is on by default. It uses ALTER DEFAULT PRIVILEGES so tables you create in the future get the same access.
Privileges are set for all tables of a schema. Per-table and per-column privileges aren't supported.
Member of
Tick the roles this role should belong to. Unticking a role removes the membership.
Privileges
The Privileges in <database> list shows what the role can currently do in this database, with the Kind, Object, Privilege and Grant option. Click Revoke to remove a privilege.
Only privileges in the connected database are shown.
Apply changes
The footer collects your edits:
- SQL preview (N) shows the N statements that will run.
- Revert discards your edits.
- Create Role (for a new role) or Apply (
⌘S) runs them.
All statements run in one transaction, so either every change is applied or none is.
