PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔媆誕嬉誕

CREATE CONSTRAINT TRIGGER

劉䓄

CREATE CONSTRAINT TRIGGER -- 垔幬婔婻桄䔇亥溘蓥埏単

臺濘

CREATE CONSTRAINT TRIGGER name
    AFTER event [ OR ... ]
    ON table_name
    [ FROM referenced_table_name ]
    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }
    FOR EACH ROW
    EXECUTE PROCEDURE funcname ( arguments )

柟誄

CREATE CONSTRAINT TRIGGERCREATE TABLE/ALTER TABLE 喙鄘嘪䫘傖埪赆 pg_dump 䫘庯录傺闼底䫘庯埗䙓垯昘攓䔇䬹枪蓥埏単㔗垄幽婉滇婺庖捞锔嘪䫘蔯螆螇䔇㔗

埗昄

name

亥溘蓥埏単䔇劉䓄㔗垂鍙录傺䔇蓥埏単劉庖儖滇 RI_ConstraintTrigger_0000 湚嚟(認麯䔇 0000 滇橉媇単毺垔䔇昊婻昄庖)㔗婘役鍴蓥埏単䔇施唍媙釂嘪䫘認婻劉庖㔗

event

蓥埏臖蓥埏単䔇庋傽㔗滇 INSERT, UPDATE, DELETE 幋婔埇傖嘪䫘 OR 毺垔崔婻唚㔗

table_name

埏䫘蓥埏単庋傽䔇臘劉䓄(埇脘橬昇嚟媞閄)

referenced_table_name

赆亥溘嚘䫘䔇臘劉䓄(埇脘橬昇嚟媞閄)㔗崡髞亥溘蓥埏単襕嘪䫘垄㔗

DEFERRABLE
NOT DEFERRABLE
INITIALLY IMMEDIATE
INITIALLY DEFERRED

埗蓕 CREATE TABLE 桺懼傖诙埡認底亥溘锬釹䔇䂖誗㔗

funcname(args)

蓥埏単崇䊖誺䘋婺脄䫘䔇庘昄㔗埗蓕 CREATE TRIGGER 诙埡䂖誗㔗

噚垹攓

CREATE CONTRAINT TRIGGER 滇 PostgreSQL 婘 SQL 湺庖嘺䇔婪䔇欷匘㔗


劯锔饡釕嬉誕
CREATE CAST婪婔亓CREATE CONVERSION