DROP_VIEW(7pg14)

πŸ“¦ version 14.24, in opensuse-leap 16.0

πŸ’… 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