pg_matviews

A system catalogue view listing the available materialized views

pg_matviews is a system catalogue view listing the available materialized views.

pg_matviews was added in PostgreSQL 9.3.

Definition by PostgreSQL version

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    |           |          |
    

Documentation: 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    |           |          |
    

Documentation: 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    |           |          |
    

Documentation: 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    |           |          |
    

Documentation: 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    |           |          |
    

Documentation: 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    |           |          |
    

Documentation: 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    |
    

Documentation: 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    |
    

Documentation: 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    |
    

Documentation: 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    |
    

Documentation: pg_matviews

Change history

This view has not been modified since it was added in PostgreSQL 9.3.

Examples

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)

Categories

DDL, System catalogue