2 .\" Title: ALTER TRIGGER
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "ALTER TRIGGER" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 ALTER_TRIGGER \- change the definition of a trigger
35 ALTER TRIGGER \fIname\fR ON \fItable_name\fR RENAME TO \fInew_name\fR
36 ALTER TRIGGER \fIname\fR ON \fItable_name\fR [ NO ] DEPENDS ON EXTENSION \fIextension_name\fR
41 changes properties of an existing trigger\&.
45 clause changes the name of the given trigger without otherwise changing the trigger definition\&. If the table that the trigger is on is a partitioned table, then corresponding clone triggers in the partitions are renamed too\&.
49 clause marks the trigger as dependent on an extension, such that if the extension is dropped, the trigger will automatically be dropped as well\&.
51 You must own the table on which the trigger acts to be allowed to change its properties\&.
56 The name of an existing trigger to alter\&.
61 The name of the table on which this trigger acts\&.
66 The new name for the trigger\&.
71 The name of the extension that the trigger is to depend on (or no longer dependent on, if
73 is specified)\&. A trigger that\*(Aqs marked as dependent on an extension is automatically dropped when the extension is dropped\&.
77 The ability to temporarily enable or disable a trigger is provided by
78 \fBALTER TABLE\fR, not by
79 \fBALTER TRIGGER\fR, because
81 has no convenient way to express the option of enabling or disabling all of a table\*(Aqs triggers at once\&.
84 To rename an existing trigger:
90 ALTER TRIGGER emp_stamp ON emp RENAME TO emp_track_chgs;
96 To mark a trigger as being dependent on an extension:
102 ALTER TRIGGER emp_stamp ON emp DEPENDS ON EXTENSION emplib;
112 extension of the SQL standard\&.
114 ALTER TABLE (\fBALTER_TABLE\fR(7))