DROP_VIEW(7pg17)

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

πŸŽ€ NAME πŸŽ€

omg bestie, this one is DROP_VIEW β€” aka DROP VIEW(7) β€” and it removes a view. Slay, but also be careful, because dropping things is very main-character energy. πŸ’…


✨ SYNOPSIS ✨

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

πŸ’– DESCRIPTION πŸ’–

DROP VIEW drops an existing view. That’s the whole vibe. But no cap: to run this command you must be the owner of the view. πŸ‘‘


πŸ¦‹ PARAMETERS πŸ¦‹

  • IF EXISTS β€” do not throw an error if the view does not exist. In that case, a notice is issued. So it’s like β€œbestie, if it’s not there, don’t scream, just let it go.” 🫢
  • name β€” the name of the view to remove. It can optionally be schema-qualified. Literally the target of the drop. 🎯
  • 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.15. It’s giving β€œconsequences? yes, automatically.” 😭πŸ”₯
  • RESTRICT β€” refuse to drop the view if any objects depend on it. This is the default. So by default it’s like β€œnope, something still needs you, we’re not doing this.” πŸ’€

🌸 EXAMPLES 🌸

This command will remove the view called kinds:

DROP VIEW kinds;

iconic. short. effective. 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 yes, mostly standard, with a lil PostgreSQL flair. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

go read those too, bestie, iykyk πŸ§šπŸ’–


cute lil sign-off: this page is from the PostgreSQL 17.11 Documentation, dated 2026. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from