---
title: pg_views
page-cloud: true
latest-operator-version: v26.2.6
latest-console-tag: v3.14.0
latest-connect-version: 4.118.0
latest-redpanda-tag: v26.2.7
docname: sql/system-catalogs/catalogs/pg_views
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_views.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/system-catalogs/catalogs/pg_views.adoc
description: The pg_views catalog contains information about the views in the database and their definitions.
page-topic-type: reference
page-git-created-date: "2026-10-20"
page-git-modified-date: "2026-10-20"
page-generated-content: none
---

# pg_views

> 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)

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

The `pg_views` catalog contains information about the views in the database and the query that defines each view. It mimics the [pg_views](https://www.postgresql.org/docs/current/view-pg-views.html) PostgreSQL system catalog.

The catalog lists only the views that you have a privilege on, in schemas that you have a privilege on.

## Columns

| Column | Type | Description |
| --- | --- | --- |
| `schemaname` | `text` | Name of the schema that contains the view |
| `viewname` | `text` | Name of the view |
| `viewowner` | `text` | _Unused._ This column is always empty. |
| `definition` | `text` | The `SELECT` query that defines the view, exactly as written in the `CREATE VIEW` statement, including line breaks |

## Examples

Create a view:

```sql
CREATE VIEW large_orders AS SELECT order_id, customer, amount FROM default_redpanda_catalog=>orders WHERE amount > 100;
```

List the views in the `public` schema and their definitions:

```sql
SELECT viewname, definition
FROM pg_views
WHERE schemaname = 'public';
```

The query returns:

```text
   viewname   |                                         definition
--------------+---------------------------------------------------------------------------------------------
 large_orders | SELECT order_id, customer, amount FROM default_redpanda_catalog=>orders WHERE amount > 100
(1 row)
```

## Suggested reading

-   [CREATE VIEW](https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-statements/create-view/)

-   [DROP VIEW](https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-statements/drop-view/)

-   [pg_class](https://docs.redpanda.com/cloud-data-platform/reference/sql/system-catalogs/catalogs/pg_class/)