触发器函数

    • 描述:获取触发器的定义信息。

      参数:待查触发器的OID。

      返回值类型:text

    • pg_get_triggerdef(oid, boolean)

      描述:获取触发器的定义信息。

      参数:待查触发器的OID及是否以pretty方式展示。

    返回值类型:text

    示例:

    1. openGauss=# select pg_get_triggerdef(oid,true) from pg_trigger;
    2. pg_get_triggerdef
    3. CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func()
    4. (2 rows)
    5. openGauss=# select pg_get_triggerdef(oid,false) from pg_trigger;
    6. CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func()
    7. CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN ((new.a IS NOT NULL)) EXECUTE PROCEDURE gtest_trigger_func()
    8. (2 rows)
    9. ```