1ALTER TRIGGER(7) PostgreSQL 12.6 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 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.
34
36 The ability to temporarily enable or disable a trigger is provided by
37 ALTER TABLE (ALTER_TABLE(7)), not by ALTER TRIGGER, because ALTER
38 TRIGGER has no convenient way to express the option of enabling or
39 disabling all of a table's triggers at once.
40
42 To rename an existing trigger:
43
44 ALTER TRIGGER emp_stamp ON emp RENAME TO emp_track_chgs;
45
46 To mark a trigger as being dependent on an extension:
47
48 ALTER TRIGGER emp_stamp ON emp DEPENDS ON EXTENSION emplib;
49
51 ALTER TRIGGER is a PostgreSQL extension of the SQL standard.
52
54 ALTER TABLE (ALTER_TABLE(7))
55
56
57
58PostgreSQL 12.6 2021 ALTER TRIGGER(7)