title: "DROP CLUSTER"
description: "DROP CLUSTER
removes an existing cluster from Materialize."
menu:
main:
parent: 'commands'
DROP CLUSTER
removes an existing cluster from Materialize. If there are indexes or materialized views depending on the cluster, you must explicitly drop them first, or use the CASCADE
option.
{{< diagram "drop-cluster.svg" >}}
Field | Use |
---|---|
IF EXISTS | Do not return an error if the specified cluster does not exist. |
cluster_name | The cluster you want to drop. For available clusters, see SHOW CLUSTERS . |
CASCADE | Remove the cluster and its dependent objects. |
RESTRICT | Do not drop the cluster if it has dependencies. (Default) |
To drop an existing cluster, run:
DROP CLUSTER auction_house;
To avoid issuing an error if the specified cluster does not exist, use the IF EXISTS
option:
DROP CLUSTER IF EXISTS auction_house;
If the cluster has dependencies, Materialize will throw an error similar to:
DROP CLUSTER auction_house;
ERROR: cannot drop cluster with active indexes or materialized views
, and you'll have to explicitly ask to also remove any dependent objects using the CASCADE
option:
DROP CLUSTER auction_house CASCADE;
The privileges required to execute this statement are:
{{< include-md file="shared-content/sql-command-privileges/drop-cluster.md" >}}