> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW ROLES

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

The `SHOW ROLES` <InternalLink path="sql-statements">statement</InternalLink> lists the roles for all databases.

<Note>
  Since the keywords `ROLES` and `USERS` can now be used interchangeably in SQL statements for enhanced PostgreSQL compatibility, `SHOW ROLES` is now an alias for <InternalLink path="show-users">`SHOW USERS`</InternalLink>.
</Note>

## Synopsis

<img src="https://mintcdn.com/cockroachlabs/tGEtnfk6iFpQGcmj/images/sql-diagrams/v26.1/show_roles.svg?fit=max&auto=format&n=tGEtnfk6iFpQGcmj&q=85&s=115b0e7c4c777678fabe096dbdb849a2" alt="show_roles syntax diagram" style={{maxWidth: "100%", overflowX: "auto"}} width="209" height="37" data-path="images/sql-diagrams/v26.1/show_roles.svg" />

<img src="https://mintcdn.com/cockroachlabs/eWXakvGwAoPAsAJg/images/generated/docs/stable/show-roles/syntax-diagram-00340742226e.svg?fit=max&auto=format&n=eWXakvGwAoPAsAJg&q=85&s=a3e6f45221af85dff48460fa9a6f02d0" alt="SQL syntax diagram" width="209" height="37" data-path="images/generated/docs/stable/show-roles/syntax-diagram-00340742226e.svg" />

## Required privileges

The role must have the <InternalLink path="select-clause">`SELECT`</InternalLink> <InternalLink path="security-reference/authorization#managing-privileges">privilege</InternalLink> on the `system.users` and `system.role_members` tables.

## Example

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ROLES;
```

```text theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
  username |    options     | member_of | estimated_last_login_time
-----------+----------------+-----------+------------------------------
  admin    | {CREATEROLE}   | {}        | NULL
  carl     | {NOLOGIN}      | {}        | NULL
  petee    | {}             | {}        | 2025-08-04 19:18:00.201402+00
  root     | {CREATEROLE}   | {admin}   | NULL
(4 rows)
```

## See also

* <InternalLink path="authorization">Authorization</InternalLink>
* <InternalLink path="create-role">`CREATE ROLE`</InternalLink>
* <InternalLink path="drop-role">`DROP ROLE`</InternalLink>
* <InternalLink path="grant">`GRANT`</InternalLink>
* <InternalLink path="revoke">`REVOKE`</InternalLink>
* <InternalLink path="security-reference/authorization#create-and-manage-users">Manage Users</InternalLink>
