GNU/Linux |
RedHat 5.2(Apollo) |
|
create_trigger(l) |
create trigger - create a new trigger
create trigger trigname {before|after}
{Event1 [OR Event2 [OR Event3]]} | ||
on relname for each {row|statement} | ||
execute procedure funcname ( arguments ) |
where EventX is one of INSERT, DELETE, UPDATE
Create Trigger will enter a new trigger into the current data base. The trigger will be associated with the relation relname and will execute the specified funcname.
Only relation owner may create a trigger on this relation.
Currently, STATEMENT triggers are not implemented.
The trigger can be specified to fire either before the operation is attempted on a tuple (e.g. before constraints are checked and the insert/update/delete is attempted) or after the operation has been attempted (e.g. after constraints are checked and the insert/update/delete has completed). If the trigger fires before then the trigger may skip the operation for the current tuple, or change tuple being inserted (for insert/update operations only). If the trigger fires after then all changes including the last insertion/updation/deletion are "visible" to trigger.
Refer to the SPI and trigger programming guides for more information.
Examples are included in the contrib area of the source distribution.
drop trigger(l).
create_trigger(l) |