]> begriffs open source - ai-pg/blob - full-docs/txt/sql-altertrigger.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-altertrigger.txt
1
2 ALTER TRIGGER
3
4    ALTER TRIGGER — change the definition of a trigger
5
6 Synopsis
7
8 ALTER TRIGGER name ON table_name RENAME TO new_name
9 ALTER TRIGGER name ON table_name [ NO ] DEPENDS ON EXTENSION extension_name
10
11 Description
12
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
27 Parameters
28
29    name
30           The name of an existing trigger to alter.
31
32    table_name
33           The name of the table on which this trigger acts.
34
35    new_name
36           The new name for the trigger.
37
38    extension_name
39           The name of the extension that the trigger is to depend on (or
40           no longer dependent on, if NO is specified). A trigger that's
41           marked as dependent on an extension is automatically dropped
42           when the extension is dropped.
43
44 Notes
45
46    The ability to temporarily enable or disable a trigger is provided by
47    ALTER TABLE, not by ALTER TRIGGER, because ALTER TRIGGER has no
48    convenient way to express the option of enabling or disabling all of a
49    table's triggers at once.
50
51 Examples
52
53    To rename an existing trigger:
54 ALTER TRIGGER emp_stamp ON emp RENAME TO emp_track_chgs;
55
56    To mark a trigger as being dependent on an extension:
57 ALTER TRIGGER emp_stamp ON emp DEPENDS ON EXTENSION emplib;
58
59 Compatibility
60
61    ALTER TRIGGER is a PostgreSQL extension of the SQL standard.
62
63 See Also
64
65    ALTER TABLE