# pg_roles

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: pg_roles
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/system-catalogs/catalogs/pg_roles
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/system-catalogs/catalogs/pg_roles.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/system-catalogs/catalogs/pg_roles.adoc
description: The pg_roles system catalog provides a publicly readable view of database roles.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/system-catalogs/catalogs/pg_roles.md -->

The `pg_roles` system catalog provides a publicly readable view of database roles. It mimics the [pg\_roles](https://www.postgresql.org/docs/current/view-pg-roles.html) PostgreSQL system view.

> 📝 **NOTE**
>
> Unlike [pg\_authid](https://docs.redpanda.com/cloud-data-platform/reference/sql/system-catalogs/catalogs/pg_authid/), `pg_roles` is accessible to all users. Passwords are masked as `**` for non-superusers.

## [](#columns)Columns

The following columns are available for querying in `pg_roles`:

| Column | Type | Description |
| --- | --- | --- |
| rolname | text | Role name |
| rolsuper | bool | Whether the role has superuser privileges |
| rolinherit | bool | Whether the role inherits privileges of roles it is a member of |
| rolcreaterole | bool | Whether the role can create other roles |
| rolcreatedb | bool | Whether the role can create databases |
| rolcanlogin | bool | Whether the role can log in |
| rolreplication | bool | Whether the role has replication privileges |
| rolconnlimit | int | Connection limit for the role (-1 means no limit) |
| rolpassword | text | Password (masked as ** for non-superusers) |
| rolvaliduntil | timestamptz | Password expiration time (NULL if no expiration) |
| rolbypassrls | bool | Whether the role bypasses row-level security policies |
| rolconfig | text | Session defaults for this role |
| oid | bigint | Object identifier for the role |

## [](#examples)Examples

```sql
SELECT rolname, rolsuper, rolcanlogin FROM pg_roles;
```