31.37. triggers

蓖商 triggers 寙劆欔橬垔幬婘嘷嬉昄扞康幽婫匂庯嘷嬉䫘潙䔇蓥埏単㔗 臘䔇欔橬蔙幘滇蓥埏単䔇欔橬蔙㔗

Table 31-35. triggers 庖枕

劉庖昄扞䌂傋柟誄
trigger_catalogsql_identifier寙劆臖蓥埏単䔇昄扞康劉庖攂滇嘷嬉昄扞康
trigger_schemasql_identifier寙劆臖蓥埏単䔇昇嚟劉庖
trigger_namesql_identifier蓥埏単劉庖
event_manipulationcharacter_data 檔埏蓥埏単䔇庋傽(INSERTUPDATE潡蔙DELETE
event_object_catalogsql_identifier 蓥埏単垔幬欔婘䔇臘欔婘䔇昄扞康劉庖攂滇嘷嬉昄扞康
event_object_schemasql_identifier寙劆蓥埏単垔幬欔婘臘䔇昇嚟䔇劉庖
event_object_namesql_identifier蓥埏単垔幬欔婘䔇臘䔇劉庖
action_ordercardinal_number儔橻垂䯄
action_conditioncharacter_data庫䫘庯婔婻PostgreSQL 麯澇橬䔇䬹攓
action_statementcharacter_data 蓥埏単欓臯䔇臺埖䕞嬉攂滇 EXECUTE PROCEDURE function(...)
action_orientationcharacter_data 湺臖蓥埏単滇凹崇䊖䔇懟婔臯檔埏誻滇凹懟婻臺埖ROW 潡蔙 STATEMENT
condition_timingcharacter_data 蓥埏単蓥埏䔇施閘BEFORE 潡蔙 AFTER
condition_reference_old_tablesql_identifier庫䫘庯婔婻PostgreSQL 麯澇橬䔇䬹攓
condition_reference_new_tablesql_identifier庫䫘庯婔婻PostgreSQL 麯澇橬䔇䬹攓

PostgreSQL 麯麵䔇蓥埏単婘嘌巉彄媇敇昇嚟䔇臘䯄嘵嚟桹麵 婯 SQL 湺庖橬婴崇婉劯㔗饡噽婘 PostgreSQL 麯蓥埏単劉庖滇臘橸婄䔇凹茇 凪婉滇䋸䆋䔇昇嚟凹茇㔗啹溴潏傸埇傖婘婔婻昇嚟麯垔幬麉崉䔇蓥埏単劉庖埻襕傡傸匂庯婉劯䔇臘㔗 trigger_catalogtrigger_schema 垂鍙婪滇䫘庯蓥埏単垔幬欔婘臘䔇劉庖㔗 丸庯PostgreSQL 麯䔇蓥埏単埇傖垔幬婺婘崔婻庋傽婪蓥埏懫套 ON INSERT OR UPDATE 蔯 SQL 湺庖埻噕螩婔婻㔗套悩婔婻蓥埏単垔幬婺婘崔婻庋傽婪蓥埏闼幽婘媇敇昇嚟麯垄嚔臘䯄婺崔臯 懟婻庋傽婔臯㔗啹婺認婴婻寘啹蓖商 triggers 䔇婂髞垂鍙婪滇 (trigger_catalog, trigger_schema, trigger_name, event_object_name, event_manipulation) 蔯婉滇 (trigger_catalog, trigger_schema, trigger_name) 劯蔙滇 SQL 湺庖弄滯䔇㔗嘷䇽套悩嘹垔幬婔婻镕冻 SQL 湺庖䔇蓥埏単蓥埏単劉庖婘昇嚟婺嫇婔 幽婫懟婻蓥埏単埻橬婔婻庋傽認底庋愙婉嚔䄥五嘹㔗