DROP_VIEW(7pg14)
π DROP VIEW π
okay bestie, welcome to the DROP VIEW page β aka DROP VIEW(7) from the PostgreSQL 14.24 Documentation β¨ this one is literally all about removing a view, and yes, the manual name is folded right in here so you don't have to go hunting for it π«Ά
πΈ NAME πΈ
DROP_VIEW β remove a view π
β¨ SYNOPSIS β¨
DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
π¦ DESCRIPTION π¦
okay so DROP VIEW drops an existing view. that's the whole vibe π
to execute this command you must be the owner of the view β like, owner energy only, no cap π
π PARAMETERS π
IF EXISTSβ bestie, this is the βdon't throw an error if the view does not existβ option. a notice is issued in this case. so it's giving graceful exit, not chaos πnameβ the name (optionally schema-qualified) of the view to remove. yes, schema-qualified is allowed β iykyk π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). it's giving βtake the whole group chat with itβ energy πRESTRICTβ refuse to drop the view if any objects depend on it. this is the default. so if you don't say anything, it's lowkey protective π‘οΈ
π EXAMPLES π
this command will remove the view called kinds:
DROP VIEW kinds;
slay, gone, periodt β¨
π COMPATIBILITY π
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. so yeah β standard-ish, with a little PostgreSQL flair π
π₯ SEE ALSO π₯
ALTER VIEW (ALTER_VIEW(7)), CREATE VIEW (CREATE_VIEW(7)) β go read those too, bestie, they're the supporting cast π«Ά
mwah π β PostgreSQL 14.24, 2026, DROP VIEW(7). bye bestie, go drop those views responsibly π§π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms