List PostgreSQL Roles and Users
pg_list_rolesList all PostgreSQL roles with attributes, superuser status, replication, login capability, and membership graph to audit access and review permissions.
Instructions
List all PostgreSQL roles with their attributes, privileges, and group memberships.
Returns both login roles (users) and group roles. Shows superuser status, replication, login capability, connection limits, password expiry, and role membership graph.
Args:
login_only: Only show roles that can log in (actual users, not groups) (default: false)
response_format: Output format
Returns: JSON: { roles: RoleInfo[], count: number } Markdown: table with all role attributes + membership info
Useful for access audits, permission reviews, and understanding role hierarchy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| login_only | No | Only show login roles (users), not group roles | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable | markdown |