PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹40. PL/Python - Python 誺䘋臺蘔媆誕嬉誕

40.2. 蓥埏単庘昄

嘷婔婻庘昄䫘啔蓥埏単䔇施唍庖噩 TD 寙劆婯蓥埏単䕩噿䔇昄唚㔗蓥埏単臯婘 TD["new"] 启/潡 TD["old"] 麯麵噙嘷愙喕埡喿庯蓥埏単庋傽㔗TD["event"] 婺寙劆傖庖严婾嘵嚟庺䯄䔇庋傽(INSERT, UPDATE, DELETE, UNKNOWN)㔗TD["when"] 寙劆 BEFORE, AFTER, UNKNOWN 幋婔㔗TD["level"] 寙劆 ROW, STATEMENT, UNKNOWN 幋婔㔗TD["name"] 寙劆蓥埏単劉庖TD["table_name"] 寙劆蓥埏単埏䫘䔇臘䔇劉庖TD["table_schema"] 寙劆蓥埏単埏䫘䔇臘䔇昇嚟TD["name"] 寙劆蓥埏単劉庖TD["relid"] 寙劆蓥埏単埏䫘䔇臘䔇 OID 㔗套悩 CREATE TRIGGER 寙拸庘昄埗昄闼幽認底埗昄埇傖锔誺 TD["args"][0]TD["args"][(n-1)] 诙冖㔗

套悩蓥埏単䔇 TD["when"]BEFORE 闼幽嘹埇傖傯 Python 庘昄誫啂 None"OK" 傖臘䴺臖臯澇橬媞櫹誫啂 "SKIP" 傖锔庺庋傽潡蔙 "MODIFY" 臘䴺嘹噾䂟媞櫹庖臖臯㔗


劯锔饡釕嬉誕
PL/Python 庘昄婪婔亓昄扞康螪閞