1ALTER TRIGGER(7) PostgreSQL 13.3 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. The RENAME
14 clause changes the name of the given trigger without otherwise changing
15 the trigger definition. The DEPENDS ON EXTENSION clause marks the
16 trigger as dependent on an extension, such that if the extension is
17 dropped, the trigger will automatically be dropped as well.
18
19 You must own the table on which the trigger acts to be allowed to
20 change its properties.
21
23 name
24 The name of an existing trigger to alter.
25
26 table_name
27 The name of the table on which this trigger acts.
28
29 new_name
30 The new name for the trigger.
31
32 extension_name
33 The name of the extension that the trigger is to depend on (or no
34 longer dependent on, if NO is specified). A trigger that's marked
35 as dependent on an extension is automatically dropped when the
36 extension is dropped.
37
39 The ability to temporarily enable or disable a trigger is provided by
40 ALTER TABLE (ALTER_TABLE(7)), not by ALTER TRIGGER, because ALTER
41 TRIGGER has no convenient way to express the option of enabling or
42 disabling all of a table's triggers at once.
43
45 To rename an existing trigger:
46
47 ALTER TRIGGER emp_stamp ON emp RENAME TO emp_track_chgs;
48
49 To mark a trigger as being dependent on an extension:
50
51 ALTER TRIGGER emp_stamp ON emp DEPENDS ON EXTENSION emplib;
52
54 ALTER TRIGGER is a PostgreSQL extension of the SQL standard.
55
57 ALTER TABLE (ALTER_TABLE(7))
58
59
60
61PostgreSQL 13.3 2021 ALTER TRIGGER(7)