1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-25 12:03:53 +03:00

Add/edit index entries.

This commit is contained in:
Peter Eisentraut
2003-08-31 17:32:24 +00:00
parent cf8e916968
commit c326d8f4f2
162 changed files with 2653 additions and 1159 deletions

View File

@@ -1,10 +1,14 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/trigger.sgml,v 1.29 2003/08/10 01:20:34 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/trigger.sgml,v 1.30 2003/08/31 17:32:20 petere Exp $
-->
<chapter id="triggers">
<title>Triggers</title>
<indexterm zone="triggers">
<primary>trigger</primary>
</indexterm>
<para>
This chapter describes how to write trigger functions. In
particular, it describes the C-language interface for trigger
@@ -98,18 +102,20 @@ $Header: /cvsroot/pgsql/doc/src/sgml/trigger.sgml,v 1.29 2003/08/10 01:20:34 tgl
<para>
When a trigger is being defined, arguments can be specified for
it. The purpose of including arguments in the trigger definition
is to allow different triggers with similar requirements to call
the same function. As an example, there could be a generalized
trigger function that takes as its arguments two column names and
puts the current user in one and the current time stamp in the
other. Properly written, this trigger function would be
independent of the specific table it is triggering on. So the
same function could be used for <command>INSERT</command> events
on any table with suitable columns, to automatically track creation
of records in a transaction table for example. It could also be
used to track last-update events if defined as an
<command>UPDATE</command> trigger.
it.<indexterm><primary>trigger</><secondary>arguments for trigger
functions</></indexterm> The purpose of including arguments in the
trigger definition is to allow different triggers with similar
requirements to call the same function. As an example, there
could be a generalized trigger function that takes as its
arguments two column names and puts the current user in one and
the current time stamp in the other. Properly written, this
trigger function would be independent of the specific table it is
triggering on. So the same function could be used for
<command>INSERT</command> events on any table with suitable
columns, to automatically track creation of records in a
transaction table for example. It could also be used to track
last-update events if defined as an <command>UPDATE</command>
trigger.
</para>
</sect1>
@@ -117,6 +123,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/trigger.sgml,v 1.29 2003/08/10 01:20:34 tgl
<sect1 id="trigger-manager">
<title>Interaction with the Trigger Manager</title>
<indexterm zone="trigger-manager">
<primary>trigger</primary>
<secondary>in C</secondary>
</indexterm>
<para>
This section describes the low-level details of the interface to a
trigger function. This information is only needed when writing a