DROP MATERIALIZED VIEW
Removes a materialized view.
Syntax
DROP MATERIALIZED VIEW [ IF EXISTS ] <name> [, ...] [ CASCADE | RESTRICT ]
Description
DROP MATERIALIZED VIEW drops an existing materialized view. To run this command, you must be the owner of the materialized view.
Parameters
-
IF EXISTSDo not throw an error if the materialized view does not exist. A notice is issued in this case.
-
<name>The name (optionally schema-qualified) of a materialized view to be dropped.
-
CASCADE | RESTRICTSpecifies whether to drop the materialized view if it has dependent database objects.
-
CASCADEdrops all dependent objects along with the materialized view. -
RESTRICTrejects the entire drop operation.RESTRICTis the default.
-
Examples
Drop materialized view test_mv:
DROP MATERIALIZED VIEW test_mv;
SQL standard compatibility
DROP MATERIALIZED VIEW is a Relyt extension to the SQL standard.