title: "DROP SOURCE"
description: "DROP SOURCE
removes a source from Materialize."
menu:
main:
parent: commands
DROP SOURCE
removes a source from Materialize. If there are objects depending
on the source, you must explicitly drop them first, or use the CASCADE
option.
{{< diagram "drop-source.svg" >}}
Field | Use |
---|---|
IF EXISTS | Do not return an error if the named source does not exist. |
source_name | The name of the source you want to remove. |
CASCADE | Remove the source and its dependent views. |
RESTRICT | Do not remove this source if any views depend on it. (Default.) |
SHOW SOURCES;
...
my_source
DROP SOURCE my_source;
SHOW SOURCES;
...
my_source
DROP SOURCE my_source CASCADE;
You can use either of the following commands:
DROP SOURCE my_source;
DROP SOURCE my_source RESTRICT;
DROP SOURCE IF EXISTS my_source;
The privileges required to execute this statement are:
{{< include-md file="shared-content/sql-command-privileges/drop-source.md" >}}