\dv [ PATTERN ]

The \dv [ PATTERN ] meta-command returns the schema name, view name, and view owner.

The following example defines a view using the SEQUENCES system table:

vmartdb=> CREATE VIEW my_seqview AS (SELECT * FROM sequences);
CREATE VIEW
 
vmartdb=> \dv
         List of views
 Schema |    Name    |  Owner
--------+------------+---------
 public | my_seqview | dbadmin
(1 row)

If a view name is provided as an argument, the result shows the schema, view name, and the following for all columns within the view's result set: schema name, view name, column name, column data type, and data type size.

vmartdb=> \dv my_seqview
                       List of View Fields
 Schema |    View    |       Column        |     Type     | Size
--------+------------+---------------------+--------------+------
 public | my_seqview | sequence_schema     | varchar(128) |  128
 public | my_seqview | sequence_name       | varchar(128) |  128
 public | my_seqview | owner_name          | varchar(128) |  128
 public | my_seqview | identity_table_name | varchar(128) |  128
 public | my_seqview | session_cache_count | int          |    8
 public | my_seqview | allow_cycle         | boolean      |    1
 public | my_seqview | output_ordered      | boolean      |    1
 public | my_seqview | increment_by        | int          |    8
 public | my_seqview | minimum             | int          |    8
 public | my_seqview | maximum             | int          |    8
 public | my_seqview | current_value       | int          |    8
 public | my_seqview | sequence_schema_id  | int          |    8
 public | my_seqview | sequence_id         | int          |    8
 public | my_seqview | owner_id            | int          |    8
 public | my_seqview | identity_table_id   | int          |    8
(15 rows)