DROP_VIEW β remove a view
| Use Case | Command | Description |
|---|---|---|
| Drop a single view | DROP VIEW view_name; | Removes the view if it exists and you own it. |
| Drop view only if it exists | DROP VIEW IF EXISTS view_name; | No error if the view is missing; a notice is issued. |
| Drop view with all dependencies | DROP VIEW view_name CASCADE; | Automatically drops objects that depend on the view. |
| Drop multiple views | DROP VIEW view1, view2; | Removes several views in one command. |
DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
DROP VIEW drops an existing view. To execute this command you must be the owner of the view.
IF EXISTS β π‘οΈ Do not throw an error if the view does not exist. A notice is issued in this case.name β π·οΈ The name (optionally schemaβqualified) of the view to remove.CASCADE β π Automatically drop objects that depend on the view (such as other views), and in turn all objects that depend on those objects (see Section 5.14).RESTRICT β π« Refuse to drop the view if any objects depend on it. This is the default.This command will remove the view called kinds:
DROP VIEW kinds;
This command conforms to the SQL standard, except that the standard only allows one view to be dropped per command, and apart from the IF EXISTS option, which is a PostgreSQL extension.
ALTER VIEW (ALTER_VIEW(7)), CREATE VIEW (CREATE_VIEW(7))
PostgreSQL 14.23 β 2026
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-24 03:43 @216.73.216.102
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)