User Guide · PostgreSQL · Roles & pg_hba

Roles, privileges & pg_hba

For PostgreSQL clusters the Database tab has a Roles & Grants view with role management, a privilege viewer and a pg_hba.conf editor. Every change is validated before it is applied, recorded in the change history and the audit log, and destructive changes go through approvals. In the console: Database tab (?tab=database) → Roles & Grants, with the sub-tabs Roles, pg_hba and history.

/clusters/2?tab=database
Roles and Grants, Roles sub-tab: roles table with status badges, Member of and Sessions columns and a Create Role button
Database tab → Roles & Grants → Roles: each role with status badges, the roles it is a member of, its open sessions, and the Create Role button.

Roles

  • Create and edit roles with login, create-database, create-role, inherit, connection limit, password and expiry (VALID UNTIL). Passwords are never written to logs or the audit trail.
  • Membership: grant a role to another role (optionally with admin option) or revoke it. Circular membership is rejected.
  • Lock / unlock: locking makes a role NOLOGIN and can end its open sessions; unlocking restores login. Useful for an incident without dropping the role.
  • Delete is destructive: it creates an approval request and nothing happens until an administrator approves it. On approval Jarwis drops the role's owned objects and then the role.
  • Roles Jarwis itself depends on (postgres, replicator, the admin account and jarwis_* roles) are marked protected; they cannot be locked, altered or dropped.

Privileges

Select a role to see what it can access across databases, schemas, tables, sequences and functions, then grant or revoke privileges per object. The view reads the live catalog, so it also reflects grants made outside Jarwis.

pg_hba.conf

The pg_hba sub-tab shows every rule in order — order matters in pg_hba.conf — with a parse status per line. You can add a rule (as raw text or by fields: type, databases, users, address, method, options), move it up or down, or delete it (delete needs approval).

Standalone & streaming

Jarwis edits the server's pg_hba.conf.

Patroni

The source of truth is Patroni's dynamic configuration (the postgresql.pg_hba key in the DCS). Jarwis writes the rules there, so all members stay identical and a failover never reverts a rule.

/clusters/2?tab=database
pg_hba sub-tab: ordered rule list with move up, move down and delete, and a warning badge on trust rules
The pg_hba sub-tab: rules in order with move up, move down and delete. trust rules carry a warning badge. Rules are validated with pg_hba_file_rules before the reload and rolled back on error.

Safe writes

Each change is backed up, written, checked against pg_hba_file_rules for errors, then reloaded and verified. If the file does not parse, or the change would lock out the admin, replication or Jarwis' own connections, it is rejected and rolled back automatically. A short Jarwis-managed block is protected and cannot be edited. Container clusters show the rules read-only.

Change history The history lists who changed which role, privilege or rule, when, the before/after and any error. Deleting a rule uses an expected text check, so if someone else reordered the file in between you get a conflict instead of deleting the wrong line.