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

时间:2024-12-13 17:15:46

语法格式

CREATE [OR REPLACE] [ 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 ) | AnonyBlock ];

其中event包含以下几种:

1
    INSERT

1
    UPDATE [ OF column_name [, ... ] ]

1
    DELETE

1
    TRUNCATE

support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-42-0580.html