DROP_TRIGGER(7)
DROP TRIGGER 💅
okay bestie, so this is a page from the PostgreSQL 18.6 docs — manual section 7, the SQL commands one. It's giving "how do I delete a trigger" energy, and honestly? Iconic. Let's get into it. 🎀
✨ NAME ✨
DROP_TRIGGER — remove a trigger, bye bye 👋💖
✨ SYNOPSIS ✨
DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
✨ DESCRIPTION ✨
So DROP TRIGGER does exactly what it says on the tin: it removes an existing trigger definition. Gone. Deleted. Not me ghosting that trigger. 💀
But — and this is the important part, bestie — to actually run this command, the current user has to be the owner of the table the trigger is defined on. No ownership, no dropping. That's the vibe check and you must pass it. 👑
✨ PARAMETERS ✨
IF EXISTS— don't be dramatic about it. If the trigger doesn't exist, this stops it from throwing an error. Instead you just get a notice. Lowkey forgiving. 🫶name— the name of the trigger you're removing. The main character you're sending off. ✨table_name— the name of the table the trigger is defined for. It can be optionally schema-qualified, so you can be extra specific if you want. 💅CASCADE— automatically drop the objects that depend on the trigger, and then, in turn, all the objects that depend on those objects. Yes, it's a whole chain reaction. See Section 5.15. 💥RESTRICT— refuse to drop the trigger if literally any objects depend on it. This is the default, so if you don't say anything, this is the energy you get. 🙈
ngl theCASCADEvsRESTRICTthing matters —CASCADEtakes the whole friend group down with it,RESTRICTis the one that says "no, I'm not doing that, something needs me." 💀
✨ EXAMPLES ✨
Wanna destroy the trigger if_dist_exists on the table films? Say less:
DROP TRIGGER if_dist_exists ON films;
periodt. that trigger is no more. 🌸
✨ COMPATIBILITY ✨
Plot twist: the DROP TRIGGER statement in PostgreSQL is incompatible with the SQL standard. 😭 In the SQL standard, trigger names are not local to tables, so the command there is simply DROP TRIGGER name. No ON table_name situation. Different rules, different world. 🦋
✨ SEE ALSO ✨
CREATE TRIGGER(CREATE_TRIGGER(7)) — you know, the one that made the trigger in the first place 🧚
and that's the whole page, bestie!! 💖✨ go forth and drop triggers responsibly, and remember: you gotta own the table. 🎀👑
PostgreSQL 18.6 · 2026 · DROP TRIGGER(7) — mwah, talk later! 💅🌸
📦 where this page comes from
- alpine 3.23: postgresql18-doc 18.6-r0 · PostgreSQL
- alpine 3.24: postgresql18-doc 18.6-r0 · PostgreSQL
- arch rolling: postgresql 18.6-4 · PostgreSQL
- fedora 43: postgresql 18.6-1.fc43 · PostgreSQL
- fedora 43: postgresql 18.6-1.fc43 · PostgreSQL
- fedora 44: postgresql 18.6-1.fc44 · PostgreSQL
- fedora 44: postgresql 18.6-1.fc44 · PostgreSQL
- nixos 26.05: postgresql 18.6
- ubuntu resolute: postgresql-client-18 18.6-0ubuntu0.26.04.1 · PostgreSQL
- ubuntu stonking: postgresql-client-18 18.6-3build2 · PostgreSQL
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms