云数据库 GAUSSDB-CREATE TRIGGER:语法格式

时间:2024-11-02 18:49:53

语法格式

1
2
3
4
5
6
7
CREATE [ CONSTRAINT ] TRIGGER name { BEFORE | AFTER | INSTEAD OF } { event [ OR ... ] }
    ON table_name
    [ FROM referenced_table_name ]
    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }
    [ FOR [ EACH ] { ROW | STATEMENT } ]
    [ WHEN ( condition ) ]
    EXECUTE PROCEDURE function_name ( arguments );

其中event包含以下几种:

1
2
3
4
    INSERT
    UPDATE [ OF column_name [, ... ] ]
    DELETE
    TRUNCATE
support.huaweicloud.com/distributed-devg-v3-gaussdb/gaussdb-12-0546.html