Supported Versions: Current (17) / 16 / 15 / 14 / 13
Development Versions: devel
Unsupported versions: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

DROP VIEW

Name

DROP VIEW  --  Removes existing views from a database

Synopsis

DROP VIEW name [, ...]
  

Inputs

name

The name of an existing view.

Outputs

DROP

The message returned if the command is successful.

ERROR: view name does not exist

This message occurs if the specified view does not exist in the database.

Description

DROP VIEW drops an existing view from the database. To execute this command you must be the owner of the view.

Notes

Refer to CREATE VIEW for information on how to create views.

Usage

This command will remove the view called kinds:

DROP VIEW kinds;
  

Compatibility

SQL92

SQL92 specifies some additional capabilities for DROP VIEW:

DROP VIEW view { RESTRICT | CASCADE }
    

Inputs

RESTRICT

Ensures that only a view with no dependent views or integrity constraints can be destroyed.

CASCADE

Any referencing views and integrity constraints will be dropped as well.

Notes

At present, to remove a referenced view from a Postgres database, you must drop it explicitly.