1ALTER TRIGGER(7) PostgreSQL 15.4 Documentation ALTER TRIGGER(7)
2
3
4
6 ALTER_TRIGGER - change the definition of a trigger
7
9 ALTER TRIGGER name ON table_name RENAME TO new_name
10 ALTER TRIGGER name ON table_name [ NO ] DEPENDS ON EXTENSION extension_name
11
13 ALTER TRIGGER changes properties of an existing trigger.
14
15 The RENAME clause changes the name of the given trigger without
16 otherwise changing the trigger definition. If the table that the
17 trigger is on is a partitioned table, then corresponding clone triggers
18 in the partitions are renamed too.
19
20 The DEPENDS ON EXTENSION clause marks the trigger as dependent on an
21 extension, such that if the extension is dropped, the trigger will
22 automatically be dropped as well.
23
24 You must own the table on which the trigger acts to be allowed to
25 change its properties.
26
28 name
29 The name of an existing trigger to alter.
30
31 table_name
32 The name of the table on which this trigger acts.
33
34 new_name
35 The new name for the trigger.
36
37 extension_name
38 The name of the extension that the trigger is to depend on (or no
39 longer dependent on, if NO is specified). A trigger that's marked
40 as dependent on an extension is automatically dropped when the
41 extension is dropped.
42
44 The ability to temporarily enable or disable a trigger is provided by
45 ALTER TABLE, not by ALTER TRIGGER, because ALTER TRIGGER has no
46 convenient way to express the option of enabling or disabling all of a
47 table's triggers at once.
48
50 To rename an existing trigger:
51
52 ALTER TRIGGER emp_stamp ON emp RENAME TO emp_track_chgs;
53
54 To mark a trigger as being dependent on an extension:
55
56 ALTER TRIGGER emp_stamp ON emp DEPENDS ON EXTENSION emplib;
57
59 ALTER TRIGGER is a PostgreSQL extension of the SQL standard.
60
62 ALTER TABLE (ALTER_TABLE(7))
63
64
65
66PostgreSQL 15.4 2023 ALTER TRIGGER(7)