Removes one or more views from the database.
Synopsis
DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]Parameters
| Parameter | Description |
|---|---|
IF EXISTS | Do not throw an error if the view does not exist. A notice is issued instead. |
name | The name of the view to drop. Optionally schema-qualified. To drop multiple views in one command, separate names with commas. |
CASCADE | Automatically drop objects that depend on the view (such as other views), and in turn all objects that depend on those objects. |
RESTRICT | Refuse to drop the view if any objects depend on it. This is the default. |
Examples
Drop the view kinds:
DROP VIEW kinds;