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 EXISTS
Do 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 | RESTRICT
Specifies whether to drop the materialized view if it has dependent database objects.
-
CASCADE
drops all dependent objects along with the materialized view. -
RESTRICT
rejects the entire drop operation.RESTRICT
is 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.