ALTER_TRIGGER(7)

๐Ÿ’… ALTER_TRIGGER โ€” change the definition of a trigger โœจ

okay bestie, so this is ALTER_TRIGGER(7) from the PostgreSQL 18.6 Documentation and it's literally the glow-up page for your triggers. no cap, it's short, it's sweet, it's giving "small but mighty." ๐ŸŽ€


โœจ SYNOPSIS โœจ

ALTER TRIGGER name ON table_name RENAME TO new_name
ALTER TRIGGER name ON table_name [ NO ] DEPENDS ON EXTENSION extension_name

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So ALTER TRIGGER changes properties of an existing trigger. that's it, that's the vibe. ๐Ÿ’–

The RENAME clause changes the name of the given trigger without otherwise changing the trigger definition. iconic, minimal effort, maximum payoff. and heads up โ€” if the table that the trigger is on is a partitioned table, then corresponding clone triggers in the partitions are renamed too. yes girl, the whole friend group gets a rebrand, fr fr. ๐Ÿ‘‘

The DEPENDS ON EXTENSION clause marks the trigger as dependent on an extension, such that if the extension is dropped, the trigger will automatically be dropped as well. it's a ride-or-die situation. extension goes down, trigger goes down with it. ๐Ÿ˜ญ

gatekeeping alert: you must own the table on which the trigger acts to be allowed to change its properties. no ownership, no edits. periodt.

๐ŸŒธ PARAMETERS ๐ŸŒธ

  • name โ€” the name of an existing trigger to alter. like, the one you're here for.
  • table_name โ€” the name of the table on which this trigger acts. its home base, its main character location. ๐Ÿ 
  • new_name โ€” the new name for the trigger. fresh start, new era. โœจ
  • extension_name โ€” the name of the extension that the trigger is to depend on (or no longer dependent on, if NO is specified). A trigger that's marked as dependent on an extension is automatically dropped when the extension is dropped. so pick your extensions wisely bestie, this is a committed relationship ๐Ÿ’œ

๐Ÿ’€ NOTES ๐Ÿ’€

The ability to temporarily enable or disable a trigger is provided by ALTER TABLE, not by ALTER TRIGGER, because ALTER TRIGGER has no convenient way to express the option of enabling or disabling all of a table's triggers at once.

so if you came here looking for the on/off switchโ€ฆ wrong page babe ๐Ÿ™ˆ ALTER TABLE is over there. not me almost sending you to the wrong function.


๐Ÿซถ EXAMPLES ๐Ÿซถ

To rename an existing trigger:

ALTER TRIGGER emp_stamp ON emp RENAME TO emp_track_chgs;

To mark a trigger as being dependent on an extension:

ALTER TRIGGER emp_stamp ON emp DEPENDS ON EXTENSION emplib;

see how clean that is?? ate and left no crumbs. ๐Ÿ”ฅ


๐ŸŒˆ COMPATIBILITY ๐ŸŒˆ

ALTER TRIGGER is a PostgreSQL extension of the SQL standard. so it's not standard-SQL behaviour, it's a PostgreSQL original. ๐Ÿ’…


โญ SEE ALSO โญ


and that's the whole page, bestie!! ๐Ÿงš no notes, flawless, we love a short manpage. this was PostgreSQL 18.6, dated 2026, and yes the original really does say ALTER TRIGGER(7) at the bottom even though the page is literally about the underscore version. slay. ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹๐ŸŒธ๐Ÿซถ๐Ÿ‘‘