pg_matviews

列出可用物化视图的系统视图

pg_matviews 是一个列出可用物化视图的系统目录视图。

pg_matviews是在PostgreSQL 9.3中添加的。

按PostgreSQL版本定义

pg_matviews (PostgreSQL 17)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 16)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 15)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 14)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 13)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 12)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 11)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 10)

              View "pg_catalog.pg_matviews"
    Column    |  Type   | Collation | Nullable | Default 
--------------+---------+-----------+----------+---------
 schemaname   | name    |           |          | 
 matviewname  | name    |           |          | 
 matviewowner | name    |           |          | 
 tablespace   | name    |           |          | 
 hasindexes   | boolean |           |          | 
 ispopulated  | boolean |           |          | 
 definition   | text    |           |          |
    

文档: pg_matviews

pg_matviews (PostgreSQL 9.6)

   View "pg_catalog.pg_matviews"
    Column    |  Type   | Modifiers 
--------------+---------+-----------
 schemaname   | name    | 
 matviewname  | name    | 
 matviewowner | name    | 
 tablespace   | name    | 
 hasindexes   | boolean | 
 ispopulated  | boolean | 
 definition   | text    |
    

文档: pg_matviews

pg_matviews (PostgreSQL 9.5)

   View "pg_catalog.pg_matviews"
    Column    |  Type   | Modifiers 
--------------+---------+-----------
 schemaname   | name    | 
 matviewname  | name    | 
 matviewowner | name    | 
 tablespace   | name    | 
 hasindexes   | boolean | 
 ispopulated  | boolean | 
 definition   | text    |
    

文档: pg_matviews

pg_matviews (PostgreSQL 9.4)

   View "pg_catalog.pg_matviews"
    Column    |  Type   | Modifiers 
--------------+---------+-----------
 schemaname   | name    | 
 matviewname  | name    | 
 matviewowner | name    | 
 tablespace   | name    | 
 hasindexes   | boolean | 
 ispopulated  | boolean | 
 definition   | text    |
    

文档: pg_matviews

pg_matviews (PostgreSQL 9.3)

   View "pg_catalog.pg_matviews"
    Column    |  Type   | Modifiers 
--------------+---------+-----------
 schemaname   | name    | 
 matviewname  | name    | 
 matviewowner | name    | 
 tablespace   | name    | 
 hasindexes   | boolean | 
 ispopulated  | boolean | 
 definition   | text    |
    

文档: pg_matviews

更改历史记录

自该视图在PostgreSQL 9.3中添加以来,它没有被修改过。

示例

postgres=# CREATE TABLE foo (id int);
CREATE TABLE

postgres=# CREATE MATERIALIZED VIEW bar AS SELECT * FROM foo;
SELECT 0

postgres=# SELECT * FROM pg_matviews ;
 schemaname | matviewname | matviewowner | tablespace | hasindexes | ispopulated |   definition   
------------+-------------+--------------+------------+------------+-------------+----------------
 public     | bar         | postgres     |            | f          | t           |  SELECT foo.id+
            |             |              |            |            |             |    FROM foo;
(1 row)

类别

DDL系统目录

另请参阅

CREATE MATERIALIZED VIEWALTER MATERIALIZED VIEWDROP MATERIALIZED VIEW

反馈

提交关于"pg_matviews"的任何评论、建议或更正 此处