This chapter provides general information about writing trigger
functions. Trigger functions can be written in most of the
available procedural languages, including PL/pgSQL (Chapter 36),
PL/Tcl (Chapter 37), PL/Perl (Chapter 38), and PL/Python
(Chapter 39). After reading this chapter, you should consult the
chapter for your favorite procedural language to find out the
language-specific details of writing a trigger in it. It is also
possible to write a trigger function in C, although most people
find it easier to use one of the procedural languages. It is not
currently possible to write a trigger function in the plain SQL
function language. A 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, either once per modified row, or once per
SQL statement. If a trigger event occurs, the trigger's function
is called at the app