postgresql_16:7.1.69.2 Parameters
PostgreSQL 16 > Reference > SQL Commands > CREATE MATERIALIZED VIEW > Parameters
IF NOT EXISTS
Do not throw an error if a materialized view with the same name already exists. A notice is issued in this case. Note that there is no guarantee that the existing materialized view is anything like the one that would have been created.
*table_name*
The name (optionally schema-qualified) of the materialized view to be created. The name must be distinct from the name of any other relation (table, sequence, index, view, materialized view, or foreign table) in the same schema.
*column_name*
The name of a column in the new materialized view. If column names are not provided, they are taken from the output column names of the query.
**USING *method***
This optional clause specifies the table access method to use to store the contents for the new materialized view; the method needs be an access method of type TABLE. See (see postgresql_16:8.12) for more information. If this option is not specified, the default table access method is chosen for the new materialized view. See (see guc-default-table-access-method) for more information.
**WITH ( *storage_parameter* [= *value*] [, ... ] )**
This clause specifies optional storage parameters for the new materialized view; see (see postgresql_16:7.1.83.2) in the (see postgresql_16:7.1.83) documentation for more information. All parameters supported for CREATE TABLE are also supported for CREATE MATERIALIZED VIEW. See (see postgresql_16:7.1.83) for more information.
**TABLESPACE *tablespace_name***
The *tablespace_name* is the name of the tablespace in which the new materialized view is to be created. If not specified, (see guc-default-tablespace) is consulted.
*query*
A SELECT (see postgresql_16:7.1.170), TABLE (see postgresql_16:7.1.170.2), or VALUES (see postgresql_16:7.1.183) command. This query will run within a security-restricted operation; in particular, calls to functions that themselves create temporary tables will fail.
WITH [ NO ] DATA
This clause specifies whether or not the materialized view should be populated at creation time. If not, the materialized view will be flagged as unscannable and cannot be queried until REFRESH MATERIALIZED VIEW is used.