]> begriffs open source - ai-pg/blob - full-docs/txt/sql-droptrigger.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-droptrigger.txt
1
2 DROP TRIGGER
3
4    DROP TRIGGER — remove a trigger
5
6 Synopsis
7
8 DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
9
10 Description
11
12    DROP TRIGGER removes an existing trigger definition. To execute this
13    command, the current user must be the owner of the table for which the
14    trigger is defined.
15
16 Parameters
17
18    IF EXISTS
19           Do not throw an error if the trigger does not exist. A notice is
20           issued in this case.
21
22    name
23           The name of the trigger to remove.
24
25    table_name
26           The name (optionally schema-qualified) of the table for which
27           the trigger is defined.
28
29    CASCADE
30           Automatically drop objects that depend on the trigger, and in
31           turn all objects that depend on those objects (see
32           Section 5.15).
33
34    RESTRICT
35           Refuse to drop the trigger if any objects depend on it. This is
36           the default.
37
38 Examples
39
40    Destroy the trigger if_dist_exists on the table films:
41 DROP TRIGGER if_dist_exists ON films;
42
43 Compatibility
44
45    The DROP TRIGGER statement in PostgreSQL is incompatible with the SQL
46    standard. In the SQL standard, trigger names are not local to tables,
47    so the command is simply DROP TRIGGER name.
48
49 See Also
50
51    CREATE TRIGGER