Materialize Documentation
s
Join the Community github/materialize

DROP SOURCE

DROP SOURCE removes a source from your Materialize instances.

Conceptual framework

Materialize maintains your instances' sources by attaching the source to its internal Differential dataflow engine. If you no longer need the source, you can drop it, which will remove it from Differential.

However, if views depend on the source you must either drop the views explicitly or use the CASCADE option.

Syntax

DROP SOURCE IF EXISTS source_name RESTRICT CASCADE
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.)

Examples

Remove a source with no dependent views

SHOW SOURCES;
...
my_source
DROP SOURCE my_source;

Remove a source with dependent views

SHOW SOURCES;
...
my_source
DROP SOURCE my_source CASCADE;

Remove a source only if it has no dependent views

You can use either of the following commands:

Do not issue an error if attempting to remove a nonexistent source

DROP SOURCE IF EXISTS my_source;