Postgres has various server-side function interfaces. Server-
side functions can be written in SQL, PLPGSQL, TCL, or C.
Trigger functions can be written in any of these languages
except SQL. Note that STATEMENT-level trigger events are not
supported in the current version. You can currently specify
BEFORE or AFTER on INSERT, DELETE or UPDATE of a tuple as a
trigger event. If a trigger event occurs, the trigger manager
(called by the Executor) sets up a TriggerData information
structure (described below) and calls the trigger function to
handle the event. The trigger function must be created before
the trigger is created as a function taking no arguments and
returning opaque. If the function is written in C, it must use
the "version 1" function manager interface. The syntax for
creating triggers is as follows: CREATE TRIGGER trigger [ BEFORE
| AFTER ] [ INSERT | DELETE | UPDATE [ OR ... ] ] ON relation
FOR EACH [ ROW | STATEMENT ] EXECUTE PROCEDURE procedure
(args);where the arguments are: The name of the trigg