DROP_MATERIALIZED_VIEW(7pg13)

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

πŸŽ€ DROP_MATERIALIZED_VIEW πŸŽ€

okay so bestie, welcome to the DROP_MATERIALIZED_VIEW page from the PostgreSQL 13.23 Documentation β€” manual DROP_MATERIALIZED_VIEW(7pg13) β€” and it's literally the guide for yeeting a materialized view. πŸ’…βœ¨


🌸 NAME 🌸

DROP_MATERIALIZED_VIEW β€” remove a materialized view. no cap, that's the whole vibe. πŸ¦‹

✨ SYNOPSIS ✨

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

πŸ’– DESCRIPTION πŸ’–

DROP MATERIALIZED VIEW drops an existing materialized view. 🫢

ok but listen: to execute this command you must be the owner of the materialized view. fr fr, owner energy only. πŸ‘‘

🧚 PARAMETERS 🧚

  • IF EXISTS β€” do not throw an error if the materialized view does not exist. A notice is issued in this case. lowkey polite. 😌
  • name β€” the name (optionally schema-qualified) of the materialized view to remove. yes, schema-qualified is allowed. πŸ’«
  • CASCADE β€” automatically drop objects that depend on the materialized view (such as other materialized views, or regular views), and in turn all objects that depend on those objects (see Section 5.14). it's giving domino effect. πŸ”₯
  • RESTRICT β€” refuse to drop the materialized view if any objects depend on it. This is the default. protective bestie behavior. πŸ›‘οΈ

πŸ“ EXAMPLES πŸ“

this command will remove the materialized view called order_summary:

DROP MATERIALIZED VIEW order_summary;

slay, gone. πŸ’€βœ¨

🌈 COMPATIBILITY 🌈

DROP MATERIALIZED VIEW is a PostgreSQL extension. iykyk. 🧚

πŸ’œ SEE ALSO πŸ’œ


PostgreSQL 13.23 Β· 2025 Β· DROP MATE...IZED VIEW(7) β€” mwah, that's the page, bestie πŸŽ€πŸ’–

πŸ“¦ where this page comes from