数据仓库服务 GAUSSDB(DWS)-触发器函数:pg_get_triggerdef(oid, boolean)

时间:2024-01-26 16:15:17

pg_get_triggerdef(oid, boolean)

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

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

返回值类型:text

仅在创建trigger时指定WHEN条件的情况下,布尔类型参数才生效。

示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
SELECT pg_get_triggerdef(oid,true) FROM pg_trigger;
                                                  pg_get_triggerdef
----------------------------------------------------------------------------------------------------------------------
 CREATE TRIGGER insert_trigger BEFORE INSERT ON test_trigger_src_tbl FOR EACH ROW EXECUTE PROCEDURE tri_insert_func()
(1 row)

SELECT pg_get_triggerdef(oid,false) FROM pg_trigger;
                                                  pg_get_triggerdef
----------------------------------------------------------------------------------------------------------------------
 CREATE TRIGGER insert_trigger BEFORE INSERT ON test_trigger_src_tbl FOR EACH ROW EXECUTE PROCEDURE tri_insert_func()
(1 row)
support.huaweicloud.com/sqlreference-820-dws/dws_06_0066.html