|
| 1 | +.\" This is -*-nroff-*- |
| 2 | +.\" XXX standard disclaimer belongs here.... |
| 3 | +.\" $Header: /cvsroot/pgsql/src/man/Attic/create_trigger.l,v 1.1 1997/09/26 15:13:08 thomas Exp $ |
| 4 | +.TH "CREATE TRIGGER" SQL 09/25/97 PostgreSQL |
| 5 | +.SH NAME |
| 6 | +create trigger\(em create a new trigger |
| 7 | +.SH SYNOPSIS |
| 8 | +.nf |
| 9 | +\fBcreatetrigger\fR trigname\fB{before|after}\fP\fB{insert|update|delete}\fB |
| 10 | +\fBon\fR relname\fBforeach{row|statement}\fR |
| 11 | +\fBexecuteprocedure\fR funcname\fB(\fR arguments\fB)\fR |
| 12 | +.fi |
| 13 | +.SH DESCRIPTION |
| 14 | +.BR"Create Trigger" |
| 15 | +will enter a new trigger into the current data base. The trigger will be |
| 16 | +associated with the relation |
| 17 | +.IR relname |
| 18 | +and will execute the specified |
| 19 | +.IR funcname. |
| 20 | + |
| 21 | +.PP |
| 22 | +The trigger can be specified to fire either |
| 23 | +.BR before |
| 24 | +the operation is attempted on a tuple (e.g. before constraints are checked and |
| 25 | +the insert/update/delete is attempted) or |
| 26 | +.BR after |
| 27 | +the operation has been attempted (e.g. after constraints are checked and the |
| 28 | +insert/update/delete has completed). |
| 29 | +If the trigger fires |
| 30 | +.BR before |
| 31 | +then the trigger may |
| 32 | +skip the operation for the current tuple, |
| 33 | +or change the current tuple (for insert/delete operations only). |
| 34 | +If the trigger fires |
| 35 | +.BR after |
| 36 | +then all changes including the last insertion/updation/deletion |
| 37 | +are "visible" to trigger. |
| 38 | + |
| 39 | +.PP |
| 40 | +Refer to the SPI and trigger programming guides for more information. |
| 41 | +.SH EXAMPLES |
| 42 | +Examples are included in the contrib area of the source distribution. |
| 43 | +.SH "SEE ALSO" |
| 44 | +drop trigger(l). |