DROP_EVENT_TRIGGER(7pg13)
π DROP EVENT TRIGGER π
ok so this is the DROP EVENT TRIGGER page from the PostgreSQL 13.23 docs, and it's honestly kind of a short one but it's still iconic, so let's get into it bestie π«Ά
β¨ NAME β¨
DROP_EVENT_TRIGGER β yeet an event trigger out of existence, remove it, delete it, it's gone girl π
πΈ SYNOPSIS πΈ
DROP EVENT TRIGGER [ IF EXISTS ] name [ CASCADE | RESTRICT ]
look at that syntax, so clean, so simple, main character energy fr fr β¨
π¦ DESCRIPTION π¦
DROP EVENT TRIGGER removes an existing event trigger. that's the whole vibe. one job, does it well π
ok but here's the important bit β to actually run this command, the current user must be the owner of the event trigger. so like, you can't just roll up and start dropping other people's triggers, that's not the move, the database said no π
π PARAMETERS π
IF EXISTSβ do not throw an error if the event trigger doesn't exist. instead a notice is issued in this case. so like, no dramatic meltdown if the thing is already gone, just a lil heads up πnameβ the name of the event trigger you're removing. yes, that's it, that's the parameter, you literally just say which one π―CASCADEβ automatically drop objects that depend on the trigger, and in turn all objects that depend on those objects (see Section 5.14). it's giving domino effect, it's giving chain reaction, it's giving be careful bestie π₯ πRESTRICTβ refuse to drop the trigger if any objects depend on it. this is the default, so if you don't say anything it's already protecting you, no cap π‘οΈ
β EXAMPLES β
destroy the trigger snitch:
DROP EVENT TRIGGER snitch;
and the snitch is GONE. bye. not me making an example of it π π
π§ COMPATIBILITY π§
there is no DROP EVENT TRIGGER statement in the SQL standard. nope. not a thing. this is a PostgreSQL original, iykyk π
π SEE ALSO π
CREATE EVENT TRIGGER(CREATE_EVENT_TRIGGER(7))ALTER EVENT TRIGGER(ALTER_EVENT_TRIGGER(7))
go read those too, they're the whole trilogy and you deserve the full lore π«Άβ¨
lowkey reminder bestie: RESTRICT is the default, so if you want the cascade chaos you gotta ask for it π
ok that's the whole page!! slayed, no notes π this was PostgreSQL 13.23 documentation, dated 2025 β mwah, stan, periodt ππ¦π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms