Web System Manage triggers
Trigger is a specification that the database should automatically execute a particular function whenever a certain type of operation is performed. Triggers can be defined to execute either before or after any INSERT, UPDATE, or DELETE operation.
The trigger function (Chapter not found) must be defined before the trigger itself can be created. The same trigger function can be used for multiple triggers.
PostgreSQL supports two types of triggers:
-
per-row trigger - a trigger function that is invoked once for each row that is affected by the statement that 'fired' the trigger.
-
per-statement trigger occurs only once per INSERT, UPDATE, or DELETE statement.
Editing table triggers is done in the tab Triggers.

-
New - opens a dialog to enter a new trigger.
-
Edit - opens trigger editing dialog. Also, this dialog can be opened by double clicking a trigger name in the list.
-
Drop — deletes a trigger
Creating/editing a trigger:

-
Name - The trigger name must be unique in the database.
-
Timing - The trigger can be specified to 'fire' either BEFORE the operation is attempted on a row or AFTER the operation has completed.
-
Event - Operation that 'fires' the trigger: INSERT, UPDATE or DELETE
-
Orientation - Type of trigger: per-row trigger (ROW) and per-statement trigger (STATEMENT).
-
Procedure - Trigger function invoked when trigger 'fires'.
-
Parameters - The list of parameters influencing the trigger function.