{"Entry":{"collection":"sql","key":"create-constraint-trigger","name":"CREATE CONSTRAINT TRIGGER","aliases":["createconstraint"],"metadata":{"aliases":["createconstraint"],"changed_in":["7.4","8.2","9.0"],"changes":[{"from":"6.5","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"7.0"},{"from":"7.0","purpose_changed":false,"renamed":{"from_file":"sql-createconstraint.htm","to_file":"sql-createconstraint.html"},"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":null,"to":"7.1"},{"from":"7.1","purpose_changed":true,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":null,"to":"7.2"},{"from":"7.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description"],"removed":[]},"status":"changed","synopsis":null,"to":"7.3"},{"from":"7.3","purpose_changed":false,"renamed":null,"sections":{"added":["parameters"],"changed":["description"],"removed":[]},"status":"changed","synopsis":{"added":["tablename constraint attributes","FOR EACH ROW EXECUTE PROCEDURE funcname ( args )"],"removed":["relation constraint attributes","FOR EACH ROW EXECUTE PROCEDURE func '(' args ')'"]},"to":"7.4"},{"from":"8.1","purpose_changed":false,"renamed":null,"sections":{"added":["compatibility"],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["AFTER event [ OR ... ]","ON table_name","[ FROM referenced_table_name ]","{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }","EXECUTE PROCEDURE funcname ( arguments )"],"removed":["AFTER events ON","tablename constraint attributes","FOR EACH ROW EXECUTE PROCEDURE funcname ( args )"]},"to":"8.2"},{"from":"8.2","purpose_changed":false,"renamed":null,"sections":{"added":["see_also"],"changed":["description","parameters","compatibility"],"removed":[]},"status":"changed","synopsis":null,"to":"8.3"},{"from":"8.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["[ WHEN ( condition ) ]","EXECUTE PROCEDURE function_name ( arguments )"],"removed":["EXECUTE PROCEDURE funcname ( arguments )"]},"to":"9.0"},{"from":"9.0","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"removed","synopsis":null,"to":"9.1"}],"content_hash":"d79eb983972837a34477355bf397d675e4d3dfe0334b6e9d6b4ea2c5813c4a30","editorial":{},"first_version":"7.0","group":"trigger","imported_at":"2026-09-30T17:43:38.313817+08:00","last_version":"9.0","name":"CREATE CONSTRAINT TRIGGER","object":"CONSTRAINT TRIGGER","position":6000,"present_in":["7.0","7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0"],"purpose":"define a new constraint trigger","purpose_zh":"","related":["create-trigger","drop-trigger","set-constraints"],"slug":"create-constraint-trigger","source_rev":"a709ab85","synopsis":"CREATE CONSTRAINT TRIGGER name\nAFTER event [ OR ... ]\nON table_name\n[ FROM referenced_table_name ]\n{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }\nFOR EACH ROW\n[ WHEN ( condition ) ]\nEXECUTE PROCEDURE function_name ( arguments )","verb":"CREATE"}},"Definition":{"Collection":"sql","Key":"create-constraint-trigger","SourceDatabase":"center","Version":"9.0","SourceTable":"sqlcmd","SourceKey":"create-constraint-trigger","SourceRevision":"a709ab85","Facts":{"anchor":"SQL-CREATECONSTRAINT","file":"sql-createconstraint.html","lang":"en","name":"CREATE CONSTRAINT TRIGGER","purpose":"define a new constraint trigger","purpose_zh":"","related":["create-trigger","drop-trigger","set-constraints"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE CONSTRAINT TRIGGER\u003c/code\u003e creates a \u003ci\u003econstraint trigger\u003c/i\u003e. This is the same as a regular trigger except that the timing of the trigger firing can be adjusted using \u003ca href=\"/docs/9.0/sql-set-constraints.html\"\u003eSET CONSTRAINTS\u003c/a\u003e. Constraint triggers must be \u003ccode class=\"literal\"\u003eAFTER ROW\u003c/code\u003e triggers. They can be fired either at the end of the statement causing the triggering event, or at the end of the containing transaction; in the latter case they are said to be \u003ci\u003edeferred\u003c/i\u003e. A pending deferred-trigger firing can also be forced to happen immediately by using \u003ccode class=\"command\"\u003eSET CONSTRAINTS\u003c/code\u003e.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003ename\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the constraint trigger. This is also the name to use when modifying the trigger's behavior using \u003ccode class=\"command\"\u003eSET CONSTRAINTS\u003c/code\u003e. The name cannot be schema-qualified — the trigger inherits the schema of its table.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003eevent\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eOne of \u003ccode class=\"literal\"\u003eINSERT\u003c/code\u003e, \u003ccode class=\"literal\"\u003eUPDATE\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eDELETE\u003c/code\u003e; this specifies the event that will fire the trigger. Multiple events can be specified using \u003ccode class=\"literal\"\u003eOR\u003c/code\u003e.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003etable_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe (possibly schema-qualified) name of the table in which the triggering events occur.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003ereferenced_table_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe (possibly schema-qualified) name of another table referenced by the constraint. This option is used for foreign-key constraints and is not recommended for general use.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"literal\"\u003eDEFERRABLE\u003c/code\u003e\u003cbr\u003e\u003ccode class=\"literal\"\u003eNOT DEFERRABLE\u003c/code\u003e\u003cbr\u003e\u003ccode class=\"literal\"\u003eINITIALLY IMMEDIATE\u003c/code\u003e\u003cbr\u003e\u003ccode class=\"literal\"\u003eINITIALLY DEFERRED\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe default timing of the trigger. See the \u003ca href=\"/docs/9.0/sql-createtable.html\"\u003eCREATE TABLE\u003c/a\u003e documentation for details of these constraint options.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003econdition\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eA Boolean expression that determines whether the trigger function will actually be executed. This acts the same as in \u003ca href=\"/docs/9.0/sql-createtrigger.html\"\u003eCREATE TRIGGER\u003c/a\u003e. Note in particular that evaluation of the \u003ccode class=\"literal\"\u003eWHEN\u003c/code\u003e condition is not deferred, but occurs immediately after the row update operation is performed. If the condition does not evaluate to \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e then the trigger is not queued for deferred execution.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003efunction_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe function to call when the trigger is fired. See \u003ca href=\"/docs/9.0/sql-createtrigger.html\"\u003eCREATE TRIGGER\u003c/a\u003e for details.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003earguments\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eOptional argument strings to pass to the trigger function. See \u003ca href=\"/docs/9.0/sql-createtrigger.html\"\u003eCREATE TRIGGER\u003c/a\u003e for details.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE CONSTRAINT TRIGGER\u003c/code\u003e is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension of the \u003cacronym\u003eSQL\u003c/acronym\u003e standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003ca href=\"/wiki/sql/create-trigger/?v=9.0\"\u003eCREATE TRIGGER\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-trigger/?v=9.0\"\u003eDROP TRIGGER\u003c/a\u003e, \u003ca href=\"/wiki/sql/set-constraints/?v=9.0\"\u003eSET CONSTRAINTS\u003c/a\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"9.0","synopsis_html":"CREATE CONSTRAINT TRIGGER \u003ccode class=\"replaceable\"\u003e\u003ci\u003ename\u003c/i\u003e\u003c/code\u003e\n    AFTER \u003ccode class=\"replaceable\"\u003e\u003ci\u003eevent\u003c/i\u003e\u003c/code\u003e [ OR ... ]\n    ON \u003ccode class=\"replaceable\"\u003e\u003ci\u003etable_name\u003c/i\u003e\u003c/code\u003e\n    [ FROM \u003ccode class=\"replaceable\"\u003e\u003ci\u003ereferenced_table_name\u003c/i\u003e\u003c/code\u003e ]\n    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }\n    FOR EACH ROW\n    [ WHEN ( \u003ccode class=\"replaceable\"\u003e\u003ci\u003econdition\u003c/i\u003e\u003c/code\u003e ) ]\n    EXECUTE PROCEDURE \u003ccode class=\"replaceable\"\u003e\u003ci\u003efunction_name\u003c/i\u003e\u003c/code\u003e ( \u003ccode class=\"replaceable\"\u003e\u003ci\u003earguments\u003c/i\u003e\u003c/code\u003e )","synopsis_text":"CREATE CONSTRAINT TRIGGER name\nAFTER event [ OR ... ]\nON table_name\n[ FROM referenced_table_name ]\n{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }\nFOR EACH ROW\n[ WHEN ( condition ) ]\nEXECUTE PROCEDURE function_name ( arguments )"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"create-constraint-trigger","SourceDatabase":"center","Version":"9.0","Locale":"en","Title":"CREATE CONSTRAINT TRIGGER","Summary":"define a new constraint trigger","BodyHTML":"\u003cpre\u003eCREATE CONSTRAINT TRIGGER name\nAFTER event [ OR ... ]\nON table_name\n[ FROM referenced_table_name ]\n{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }\nFOR EACH ROW\n[ WHEN ( condition ) ]\nEXECUTE PROCEDURE function_name ( arguments )\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eCREATE CONSTRAINT TRIGGER\u003c/code\u003e creates a \u003ci\u003econstraint trigger\u003c/i\u003e. This is the same as a regular trigger except that the timing of the trigger firing can be adjusted using \u003ca href=\"/docs/9.0/sql-set-constraints.html\" rel=\"nofollow\"\u003eSET CONSTRAINTS\u003c/a\u003e. Constraint triggers must be \u003ccode\u003eAFTER ROW\u003c/code\u003e triggers. They can be fired either at the end of the statement causing the triggering event, or at the end of the containing transaction; in the latter case they are said to be \u003ci\u003edeferred\u003c/i\u003e. A pending deferred-trigger firing can also be forced to happen immediately by using \u003ccode\u003eSET CONSTRAINTS\u003c/code\u003e.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eParameters\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003ccode\u003e\u003ci\u003ename\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the constraint trigger. This is also the name to use when modifying the trigger\u0026#39;s behavior using \u003ccode\u003eSET CONSTRAINTS\u003c/code\u003e. The name cannot be schema-qualified — the trigger inherits the schema of its table.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode\u003e\u003ci\u003eevent\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eOne of \u003ccode\u003eINSERT\u003c/code\u003e, \u003ccode\u003eUPDATE\u003c/code\u003e, or \u003ccode\u003eDELETE\u003c/code\u003e; this specifies the event that will fire the trigger. Multiple events can be specified using \u003ccode\u003eOR\u003c/code\u003e.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode\u003e\u003ci\u003etable_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe (possibly schema-qualified) name of the table in which the triggering events occur.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode\u003e\u003ci\u003ereferenced_table_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe (possibly schema-qualified) name of another table referenced by the constraint. This option is used for foreign-key constraints and is not recommended for general use.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode\u003eDEFERRABLE\u003c/code\u003e\u003cbr\u003e\u003ccode\u003eNOT DEFERRABLE\u003c/code\u003e\u003cbr\u003e\u003ccode\u003eINITIALLY IMMEDIATE\u003c/code\u003e\u003cbr\u003e\u003ccode\u003eINITIALLY DEFERRED\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe default timing of the trigger. See the \u003ca href=\"/docs/9.0/sql-createtable.html\" rel=\"nofollow\"\u003eCREATE TABLE\u003c/a\u003e documentation for details of these constraint options.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode\u003e\u003ci\u003econdition\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eA Boolean expression that determines whether the trigger function will actually be executed. This acts the same as in \u003ca href=\"/docs/9.0/sql-createtrigger.html\" rel=\"nofollow\"\u003eCREATE TRIGGER\u003c/a\u003e. Note in particular that evaluation of the \u003ccode\u003eWHEN\u003c/code\u003e condition is not deferred, but occurs immediately after the row update operation is performed. If the condition does not evaluate to \u003ccode\u003etrue\u003c/code\u003e then the trigger is not queued for deferred execution.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode\u003e\u003ci\u003efunction_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe function to call when the trigger is fired. See \u003ca href=\"/docs/9.0/sql-createtrigger.html\" rel=\"nofollow\"\u003eCREATE TRIGGER\u003c/a\u003e for details.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode\u003e\u003ci\u003earguments\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eOptional argument strings to pass to the trigger function. See \u003ca href=\"/docs/9.0/sql-createtrigger.html\" rel=\"nofollow\"\u003eCREATE TRIGGER\u003c/a\u003e for details.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eCREATE CONSTRAINT TRIGGER\u003c/code\u003e is a \u003cspan\u003ePostgreSQL\u003c/span\u003e extension of the \u003cacronym\u003eSQL\u003c/acronym\u003e standard.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eSee Also\u003c/h2\u003e\u003ca href=\"/wiki/sql/create-trigger/?v=9.0\" rel=\"nofollow\"\u003eCREATE TRIGGER\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-trigger/?v=9.0\" rel=\"nofollow\"\u003eDROP TRIGGER\u003c/a\u003e, \u003ca href=\"/wiki/sql/set-constraints/?v=9.0\" rel=\"nofollow\"\u003eSET CONSTRAINTS\u003c/a\u003e\u003c/section\u003e","SourceRevision":"a709ab85","ContentHash":"9b21372f279fcea3e21c7f14786bd9e4cbdf386d0631810034c4c850359f8969","Payload":{"related":["create-trigger","drop-trigger","set-constraints"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE CONSTRAINT TRIGGER\u003c/code\u003e creates a \u003ci\u003econstraint trigger\u003c/i\u003e. This is the same as a regular trigger except that the timing of the trigger firing can be adjusted using \u003ca href=\"/docs/9.0/sql-set-constraints.html\"\u003eSET CONSTRAINTS\u003c/a\u003e. Constraint triggers must be \u003ccode class=\"literal\"\u003eAFTER ROW\u003c/code\u003e triggers. They can be fired either at the end of the statement causing the triggering event, or at the end of the containing transaction; in the latter case they are said to be \u003ci\u003edeferred\u003c/i\u003e. A pending deferred-trigger firing can also be forced to happen immediately by using \u003ccode class=\"command\"\u003eSET CONSTRAINTS\u003c/code\u003e.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003ename\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the constraint trigger. This is also the name to use when modifying the trigger's behavior using \u003ccode class=\"command\"\u003eSET CONSTRAINTS\u003c/code\u003e. The name cannot be schema-qualified — the trigger inherits the schema of its table.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003eevent\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eOne of \u003ccode class=\"literal\"\u003eINSERT\u003c/code\u003e, \u003ccode class=\"literal\"\u003eUPDATE\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eDELETE\u003c/code\u003e; this specifies the event that will fire the trigger. Multiple events can be specified using \u003ccode class=\"literal\"\u003eOR\u003c/code\u003e.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003etable_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe (possibly schema-qualified) name of the table in which the triggering events occur.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003ereferenced_table_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe (possibly schema-qualified) name of another table referenced by the constraint. This option is used for foreign-key constraints and is not recommended for general use.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"literal\"\u003eDEFERRABLE\u003c/code\u003e\u003cbr\u003e\u003ccode class=\"literal\"\u003eNOT DEFERRABLE\u003c/code\u003e\u003cbr\u003e\u003ccode class=\"literal\"\u003eINITIALLY IMMEDIATE\u003c/code\u003e\u003cbr\u003e\u003ccode class=\"literal\"\u003eINITIALLY DEFERRED\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe default timing of the trigger. See the \u003ca href=\"/docs/9.0/sql-createtable.html\"\u003eCREATE TABLE\u003c/a\u003e documentation for details of these constraint options.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003econdition\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eA Boolean expression that determines whether the trigger function will actually be executed. This acts the same as in \u003ca href=\"/docs/9.0/sql-createtrigger.html\"\u003eCREATE TRIGGER\u003c/a\u003e. Note in particular that evaluation of the \u003ccode class=\"literal\"\u003eWHEN\u003c/code\u003e condition is not deferred, but occurs immediately after the row update operation is performed. If the condition does not evaluate to \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e then the trigger is not queued for deferred execution.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003efunction_name\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe function to call when the trigger is fired. See \u003ca href=\"/docs/9.0/sql-createtrigger.html\"\u003eCREATE TRIGGER\u003c/a\u003e for details.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003ccode class=\"replaceable\"\u003e\u003ci\u003earguments\u003c/i\u003e\u003c/code\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eOptional argument strings to pass to the trigger function. See \u003ca href=\"/docs/9.0/sql-createtrigger.html\"\u003eCREATE TRIGGER\u003c/a\u003e for details.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE CONSTRAINT TRIGGER\u003c/code\u003e is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension of the \u003cacronym\u003eSQL\u003c/acronym\u003e standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003ca href=\"/wiki/sql/create-trigger/?v=9.0\"\u003eCREATE TRIGGER\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-trigger/?v=9.0\"\u003eDROP TRIGGER\u003c/a\u003e, \u003ca href=\"/wiki/sql/set-constraints/?v=9.0\"\u003eSET CONSTRAINTS\u003c/a\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","synopsis_html":"CREATE CONSTRAINT TRIGGER \u003ccode class=\"replaceable\"\u003e\u003ci\u003ename\u003c/i\u003e\u003c/code\u003e\n    AFTER \u003ccode class=\"replaceable\"\u003e\u003ci\u003eevent\u003c/i\u003e\u003c/code\u003e [ OR ... ]\n    ON \u003ccode class=\"replaceable\"\u003e\u003ci\u003etable_name\u003c/i\u003e\u003c/code\u003e\n    [ FROM \u003ccode class=\"replaceable\"\u003e\u003ci\u003ereferenced_table_name\u003c/i\u003e\u003c/code\u003e ]\n    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }\n    FOR EACH ROW\n    [ WHEN ( \u003ccode class=\"replaceable\"\u003e\u003ci\u003econdition\u003c/i\u003e\u003c/code\u003e ) ]\n    EXECUTE PROCEDURE \u003ccode class=\"replaceable\"\u003e\u003ci\u003efunction_name\u003c/i\u003e\u003c/code\u003e ( \u003ccode class=\"replaceable\"\u003e\u003ci\u003earguments\u003c/i\u003e\u003c/code\u003e )","synopsis_text":"CREATE CONSTRAINT TRIGGER name\nAFTER event [ OR ... ]\nON table_name\n[ FROM referenced_table_name ]\n{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }\nFOR EACH ROW\n[ WHEN ( condition ) ]\nEXECUTE PROCEDURE function_name ( arguments )"}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["7.0","7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
