DROP_TRIGGER(7pg15)
okay bestie, welcome to DROP TRIGGER from the PostgreSQL 15.19 Documentation β this is the page where triggers get β¨removedβ¨, and yes, itβs giving very βclean up your database closetβ energy. π
π NAME π
DROP_TRIGGER β remove a trigger. literally what it says on the tin, no cap. π
β¨ SYNOPSIS β¨
DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
πΈ DESCRIPTION πΈ
DROP TRIGGER removes an existing trigger definition. π«Ά
To execute this command, the current user must be the owner of the table for which the trigger is defined. thatβs the vibe check for permissions, bestie β table owner only. π
π PARAMETERS π
IF EXISTSβ do not throw an error if the trigger does not exist. a notice is issued in this case. so chill, it wonβt be dramatic about it. πnameβ the name of the trigger to remove. yes, the actual trigger getting dropped. π―table_nameβ the name (optionally schema-qualified) of the table for which the trigger is defined. ποΈ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 the βand take everyone who came with youβ option. πRESTRICTβ refuse to drop the trigger if any objects depend on it. this is the default. very βnope, not unless everyoneβs clearβ energy. π«
π¦ EXAMPLES π¦
Destroy the trigger if_dist_exists on the table films:
DROP TRIGGER if_dist_exists ON films;
slay, gone. β¨
π COMPATIBILITY π
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. so yeah, PostgreSQL said βweβre doing it our wayβ and honestly? iconic. π
π«Ά SEE ALSO π«Ά
CREATE TRIGGER (CREATE_TRIGGER(7)) β go make one if youβre feeling brave. π
thatβs the whole page, bestie β PostgreSQL 15.19, dated 2026, and itβs still DROP TRIGGER(7) at the end of the day. mwah. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-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