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

# SHOW USERS

The `SHOW USERS` [statement](https://docs.cockroachlabs.com/docs/v24.2/sql-statements) lists the users for all databases.

> [!NOTE]
>
> Since the keywords `ROLES` and `USERS` can now be used interchangeably in SQL statements for enhanced PostgreSQL compatibility, `SHOW USERS` is now an alias for [`SHOW ROLES`](https://docs.cockroachlabs.com/docs/v24.2/show-roles).

## Synopsis

![show\_users syntax diagram](https://mintcdn.com/cockroachlabs/O8LdfYQ-dz7oGPVh/images/sql-diagrams/v24.2/show_users.svg?fit=max\&auto=format\&n=O8LdfYQ-dz7oGPVh\&q=85\&s=fd4e6123bc6ca27b955e03536b01bb72)

## Required privileges

The user must have the [`SELECT`](https://docs.cockroachlabs.com/docs/v24.2/select-clause) [privilege](https://docs.cockroachlabs.com/docs/v24.2/security-reference/authorization#managing-privileges) on the `system.users` and `system.role_members` tables.

## Example

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

```
  username |  options   | member_of
-----------+------------+------------
  admin    | CREATEROLE | {}
  carl     | NOLOGIN    | {}
  petee    |            | {}
  root     | CREATEROLE | {admin}
(4 rows)
```

Alternatively, within the built-in SQL shell, you can use the `\du` [shell command](https://docs.cockroachlabs.com/docs/v24.2/cockroach-sql#commands):

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> \du
```

```
  username |  options   | member_of
-----------+------------+------------
  admin    | CREATEROLE | {}
  carl     | NOLOGIN    | {}
  petee    |            | {}
  root     | CREATEROLE | {admin}
(4 rows)
```

## See also

* [`CREATE USER`](https://docs.cockroachlabs.com/docs/v24.2/create-user)
* [Manage Users](https://docs.cockroachlabs.com/docs/v24.2/security-reference/authorization#create-and-manage-users)
