- buster 11.9-0+deb10u1
|CREATE MATERIALIZED VIEW(7)||PostgreSQL 11.9 Documentation||CREATE MATERIALIZED VIEW(7)|
NAME¶CREATE_MATERIALIZED_VIEW - define a new materialized view
CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] table_name [ (column_name [, ...] ) ] [ WITH ( storage_parameter [= value] [, ... ] ) ] [ TABLESPACE tablespace_name ] AS query [ WITH [ NO ] DATA ]
DESCRIPTION¶CREATE MATERIALIZED VIEW defines a materialized view of a query. The query is executed and used to populate the view at the time the command is issued (unless WITH NO DATA is used) and may be refreshed later using REFRESH MATERIALIZED VIEW.
CREATE MATERIALIZED VIEW is similar to CREATE TABLE AS, except that it also remembers the query used to initialize the view, so that it can be refreshed later upon demand. A materialized view has many of the same properties as a table, but there is no support for temporary materialized views or automatic generation of OIDs.
PARAMETERS¶IF NOT EXISTS
WITH ( storage_parameter [= value] [, ... ] )
WITH [ NO ] DATA
COMPATIBILITY¶CREATE MATERIALIZED VIEW is a PostgreSQL extension.
SEE ALSO¶ALTER MATERIALIZED VIEW (ALTER_MATERIALIZED_VIEW(7)), CREATE TABLE AS (CREATE_TABLE_AS(7)), CREATE VIEW (CREATE_VIEW(7)), DROP MATERIALIZED VIEW (DROP_MATERIALIZED_VIEW(7)), REFRESH MATERIALIZED VIEW (REFRESH_MATERIALIZED_VIEW(7))