doc-exports/docs/dws/dev/dws_04_0793.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

8.2 KiB

PG_VIEWS

PG_VIEWS displays basic information about each view in the database.

Table 1 PG_VIEWS columns

Name

Type

Reference

Description

schemaname

name

PG_NAMESPACE.nspname

Name of the schema that contains the view

viewname

name

PG_CLASS.relname

View name

viewowner

name

PG_AUTHID.Erolname

Owner of the view

definition

text

-

Definition of the view

Example

Query all the views in a specified schema.

1
2
3
4
5
6
SELECT * FROM pg_views WHERE schemaname = 'myschema';
 schemaname | viewname | viewowner |                                    definition
------------+----------+-----------+----------------------------------------------------------------------------------
 myschema   | myview   | dbadmin   | SELECT  * FROM pg_tablespace WHERE (pg_tablespace.spcname = 'pg_default'::name);
 myschema   | v1       | dbadmin   | SELECT  * FROM t1 WHERE (t1.c1 > 200);
(2 rows)