DROP_VIEW(7pg15)

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

πŸŽ€ NAME πŸŽ€

Okay so this is the DROP VIEW(7) page from the PostgreSQL 15.19 Documentation, and it's literally about one thing: removing a view. No cap. ✨

DROP VIEW drops an existing view. To run this command, you must be the owner of the view β€” owner energy only, bestie. πŸ‘‘


✨ SYNOPSIS ✨

DROP VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

πŸ’– DESCRIPTION πŸ’–

DROP VIEW drops an existing view. To execute this command you must be the owner of the view. That's the whole vibe check: existing view, you own it, it goes poof. 🫢


πŸ¦‹ PARAMETERS πŸ¦‹

  • IF EXISTS β€” do not throw an error if the view does not exist. In that case, a notice is issued. Very "no drama, just a little heads-up" energy. πŸ™ˆ
  • name β€” the name of the view to remove, optionally schema-qualified. Like, schema.view is valid, 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 chain reaction, but make it SQL. πŸ’…
  • 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. That view is gone. πŸ¦‹


πŸ’€ 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 β€” mostly standard, with a little PostgreSQL main character energy. πŸ‘‘


🌈 SEE ALSO 🌈


And that's the whole manual page, bestie: DROP VIEW(7) brought to you by PostgreSQL 15.19, dated 2026. Periodt. πŸ’–πŸŽ€

πŸ“¦ where this page comes from