DROP_TRIGGER(7pg14)
π DROP TRIGGER π
okay so this is the DROP TRIGGER page straight out of the PostgreSQL 14.24 Documentation, and bestie, it's genuinely so straightforward you're gonna eat this up. it lives in manual section 7 (that's the SQL commands girlies), and it's all about yeeting a trigger into the void. let's get into it π«Ά
β¨ NAME β¨
DROP_TRIGGER β remove a trigger. that's it, that's the whole vibe. deleting a trigger definition. bye-bye. π
β¨ SYNOPSIS β¨
DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
look at her. iconic. the square brackets are optional bits, and the | means "pick one of these, not both" β you know the drill π
β¨ DESCRIPTION β¨
DROP TRIGGER removes an existing trigger definition. literally just deletes it from existence, no cap.
β οΈ important vibe check: to run this command, the current user must be the owner of the table for which the trigger is defined. not your friend, not your coworker β you. so if it errors out at you, that's probably why π
πΈ PARAMETERS πΈ
IF EXISTSβ do not throw an error if the trigger does not exist. instead a notice is issued in this case. (so like, it's chill about it, but it will mention it π)nameβ the name of the trigger to remove. the actual thing you're yeeting.table_nameβ the name (optionally schema-qualified) of the table for which the trigger is defined. yes, schema-qualified is allowed, slay.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 chain reaction π₯RESTRICTβ refuse to drop the trigger if any objects depend on it. this is the default, bestie. so the safe option is already loaded for you β¨
π EXAMPLES π
destroy the trigger if_dist_exists on the table films:
DROP TRIGGER if_dist_exists ON films;
one line. that's it. go off π
π COMPATIBILITY π
okay here's the tea: 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 is simply:
DROP TRIGGER name
no ON table_name needed over there. so if you're porting stuff around, keep that in mind, iykyk π
π¦ SEE ALSO π¦
CREATE TRIGGER(CREATE_TRIGGER(7)) β you know, the other half of this relationship π
and that's the whole page!! cute little sign-off time: this was PostgreSQL 14.24, dated 2026 π go forth and drop those triggers responsibly, bestie πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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