Appearance
sys.view
A system view that returns information about the user-defined views in the database.
Column Name | Data Type | Description |
---|---|---|
view_id | bigint | Unique ID of the view. |
database_id | bigint | Unique ID of the database where the view was created. |
schema_id | bigint | Unique ID of the schema where the view was created. Join to sys.schema to get the schema name. |
name | text | Name of the view. |
owner_id | bigint | Unique ID of the user who owns the view. Join to sys.user to get the name of the user. |
definition | text | SQL text of the view. |
is_temp | boolean | Whether the view was created as a temporary view (f =persistent; t =temporary). |
creation_time | timestamptz | When the view was created. |
database_name | text | Name of the database where the procedure was created. |
For example:
premdb=# select * from sys.view;
view_id | database_id | schema_id | name | owner_id | definition | is_temp | creation_time | database_name
---------+-------------+-----------+-----------+----------+--------------------------------------------+---------+-------------------------------+---------------
19125 | 16395 | 19124 | matchview | 10 | SELECT match.seasonid, +| f | 2020-02-17 20:48:13.813629-08 | premdb
| | | | | match.matchday, +| | |
| | | | | match.htid, +| | |
| | | | | match.atid, +| | |
| | | | | match.ftscore, +| | |
| | | | | match.htscore +| | |
| | | | | FROM match +| | |
| | | | | WHERE (match.seasonid BETWEEN 5 AND 15); | | |
(1 row)
Parent topic:System Views