ALTER_TRIGGER(7pg13)
π NAME π
okay bestie, welcome to ALTER_TRIGGER(7pg13) β aka the ALTER TRIGGER page. It's literally about changing the definition of a trigger, and yes, we're gonna get into it. no cap. β¨
β¨ SYNOPSIS β¨
ALTER TRIGGER name ON table_name RENAME TO new_name
ALTER TRIGGER name ON table_name [ NO ] DEPENDS ON EXTENSION extension_name
π¦ DESCRIPTION π¦
ALTER TRIGGER changes properties of an existing trigger. The RENAME clause changes the name of the given trigger without otherwise changing the trigger definition. 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. π
You must own the table on which the trigger acts to be allowed to change its properties. periodt. π
π PARAMETERS π
nameβ the name of an existing trigger you're altering. πtable_nameβ the name of the table on which this trigger acts. πΈnew_nameβ the new name for the trigger. πextension_nameβ the name of the extension that the trigger is to depend on (or no longer dependent on, ifNOis specified). A trigger that's marked as dependent on an extension is automatically dropped when the extension is dropped. π¦
πΈ NOTES πΈ
quick heads-up bestie: the ability to temporarily enable or disable a trigger is provided by ALTER TABLE (ALTER_TABLE(7)), 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. iykyk. π
π₯ 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;
π COMPATIBILITY π
ALTER TRIGGER is a PostgreSQL extension of the SQL standard. slay, but make it PostgreSQL. β¨
π SEE ALSO π
ALTER TABLE(ALTER_TABLE(7)) β yes, that's the one you want for the enable/disable shenanigans. π«Ά
okay that's the whole page β PostgreSQL 13.23, dated 2025, and the footer says ALTER TRIGGER(7). bye bestie, go alter some triggers π
β¨
π¦ 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