DROP MATERIALIZED VIEW - Amazon Redshift

DROP MATERIALIZED VIEW

Removes a materialized view.

For more information about materialized views, see Creating materialized views in Amazon Redshift.

Syntax

DROP MATERIALIZED VIEW [ IF EXISTS ]  mv_name
            

Parameters

IF EXISTS

A clause that specifies to check if the named materialized view exists. If the materialized view doesn't exist, then the DROP MATERIALIZED VIEW command returns an error message. This clause is useful when scripting, to keep the script from failing if you drop a nonexistent materialized view.

mv_name

The name of the materialized view to be dropped.

Usage Notes

Only the owner of a materialized view can use DROP MATERIALIZED VIEW on that view.

Example

The following example drops the tickets_mv materialized view.

DROP MATERIALIZED VIEW tickets_mv;