Cloud
pg_views
The pg_views catalog contains information about the views in the database and the query that defines each view. It mimics the pg_views 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 |
|---|---|---|
|
|
Name of the schema that contains the view |
|
|
Name of the view |
|
|
Unused. This column is always empty. |
|
|
The |
Examples
Create a view:
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:
SELECT viewname, definition
FROM pg_views
WHERE schemaname = 'public';
The query returns:
viewname | definition
--------------+---------------------------------------------------------------------------------------------
large_orders | SELECT order_id, customer, amount FROM default_redpanda_catalog=>orders WHERE amount > 100
(1 row)
Was this helpful?