Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

DROP MATERIALIZED VIEW

Focus mode
DROP MATERIALIZED VIEW - Amazon Redshift

Removes a materialized view.

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

Syntax

DROP MATERIALIZED VIEW [ IF EXISTS ] mv_name [ CASCADE | RESTRICT ]

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.

CASCADE

A clause that indicates to automatically drop objects that the materialized view depends on, such as other views.

RESTRICT

A clause that indicates to not drop the materialized view if any objects depend on it. This is the default.

Usage Notes

Only the owner of a materialized view can use DROP MATERIALIZED VIEW on that view. A superuser or a user who has specifically been granted DROP privileges can be exceptions to this.

When you write a drop statement for a materialized view and a view with a matching name exists, it results in an error that instructs you to use DROP VIEW. An error occurs even in a case where you use DROP MATERIALIZED VIEW IF EXISTS.

Example

The following example drops the tickets_mv materialized view.

DROP MATERIALIZED VIEW tickets_mv;

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.