DROP_TRIGGER(7pg15)

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

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