DROP_VIEW(7pg13)

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

πŸ’… DROP VIEW (7pg13) πŸ’…

okay so bestie, welcome to the PostgreSQL 13.23 Documentation page for DROP VIEW β€” yes, the manual name is folded right in near the top like a lil name tag πŸŽ€. This is the whole glow-up of DROP_VIEW, and it's giving β€œremove a view” energy. ✨


🌸 NAME 🌸

DROP_VIEW β€” remove a view πŸ’–

✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

DROP VIEW drops an existing view. Simple as that. No cap. To execute this command, you must be the owner of the view β€” like, it's their view, their rules, periodt. πŸ’…

πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” do not throw an error if the view does not exist. A notice is issued in this case. So if it's already gone, you get a lil notice instead of a whole error moment. πŸ™ˆ
  • name β€” the name (optionally schema-qualified) of the view to remove. That's the target, bestie. 🎯
  • 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 domino effect, lowkey. πŸ”₯
  • RESTRICT β€” refuse to drop the view if any objects depend on it. This is the default. Safe and sound, no cap. πŸ›‘οΈ

🌈 EXAMPLES 🌈

This command will remove the view called kinds:

DROP VIEW kinds;

Iconic. Simple. Slay. πŸ’–

⭐ 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, but with a PostgreSQL twist. πŸ’«

πŸ‘‘ SEE ALSO πŸ‘‘

These are your besties for view-related lore. iykyk. 🫢


That's the whole vibe. This page is brought to you by PostgreSQL 13.23, dated 2025 β€” mwah, bye bestie! πŸ’‹βœ¨

πŸ“¦ where this page comes from