~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to docs/en_US/pg/infoschema-triggers.html

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Enrici
  • Date: 2004-12-14 23:46:39 UTC
  • Revision ID: james.westby@ubuntu.com-20041214234639-tve0i5l49fq13jli
Tags: upstream-1.2.0
Import upstream version 1.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 
4
<title>30.37.�triggers</title>
 
5
<link rel="stylesheet" href="stylesheet.css" type="text/css">
 
6
<link rev="made" href="pgsql-docs@postgresql.org">
 
7
<meta name="generator" content="DocBook XSL Stylesheets V1.64.1">
 
8
<link rel="home" href="index.html" title="PostgreSQL 8.0.0beta5 Documentation">
 
9
<link rel="up" href="information-schema.html" title="Chapter�30.�The Information Schema">
 
10
<link rel="previous" href="infoschema-tables.html" title="30.36.�tables">
 
11
<link rel="next" href="infoschema-usage-privileges.html" title="30.38.�usage_privileges">
 
12
</head>
 
13
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
 
14
<div class="titlepage">
 
15
<div><div><h2 class="title" style="clear: both">
 
16
<a name="infoschema-triggers"></a>30.37.�<tt class="literal">triggers</tt></h2></div></div>
 
17
<div></div>
 
18
</div>
 
19
<p>   The view <tt class="literal">triggers</tt> contains all triggers defined
 
20
   in the current database that are owned by the current user.  (The
 
21
   owner of the table is the owner of the trigger.)
 
22
  </p>
 
23
<div class="table">
 
24
<a name="id2628070"></a><p class="title"><b>Table�30.35.�<tt class="literal">triggers</tt> Columns</b></p>
 
25
<table summary="triggers Columns" border="1">
 
26
<colgroup>
 
27
<col>
 
28
<col>
 
29
<col>
 
30
</colgroup>
 
31
<thead><tr>
 
32
<th>Name</th>
 
33
<th>Data Type</th>
 
34
<th>Description</th>
 
35
</tr></thead>
 
36
<tbody>
 
37
<tr>
 
38
<td><tt class="literal">trigger_catalog</tt></td>
 
39
<td><tt class="type">sql_identifier</tt></td>
 
40
<td>Name of the database that contains the trigger (always the current database)</td>
 
41
</tr>
 
42
<tr>
 
43
<td><tt class="literal">trigger_schema</tt></td>
 
44
<td><tt class="type">sql_identifier</tt></td>
 
45
<td>Name of the schema that contains the trigger</td>
 
46
</tr>
 
47
<tr>
 
48
<td><tt class="literal">trigger_name</tt></td>
 
49
<td><tt class="type">sql_identifier</tt></td>
 
50
<td>Name of the trigger</td>
 
51
</tr>
 
52
<tr>
 
53
<td><tt class="literal">event_manipulation</tt></td>
 
54
<td><tt class="type">character_data</tt></td>
 
55
<td>       Event that fires the trigger (<tt class="literal">INSERT</tt>,
 
56
       <tt class="literal">UPDATE</tt>, or <tt class="literal">DELETE</tt>)
 
57
      </td>
 
58
</tr>
 
59
<tr>
 
60
<td><tt class="literal">event_object_catalog</tt></td>
 
61
<td><tt class="type">sql_identifier</tt></td>
 
62
<td>       Name of the database that contains the table that the trigger
 
63
       is defined on (always the current database)
 
64
      </td>
 
65
</tr>
 
66
<tr>
 
67
<td><tt class="literal">event_object_schema</tt></td>
 
68
<td><tt class="type">sql_identifier</tt></td>
 
69
<td>Name of the schema that contains the table that the trigger is defined on</td>
 
70
</tr>
 
71
<tr>
 
72
<td><tt class="literal">event_object_name</tt></td>
 
73
<td><tt class="type">sql_identifier</tt></td>
 
74
<td>Name of the table that the trigger is defined on</td>
 
75
</tr>
 
76
<tr>
 
77
<td><tt class="literal">action_order</tt></td>
 
78
<td><tt class="type">cardinal_number</tt></td>
 
79
<td>Not yet implemented</td>
 
80
</tr>
 
81
<tr>
 
82
<td><tt class="literal">action_condition</tt></td>
 
83
<td><tt class="type">character_data</tt></td>
 
84
<td>Applies to a feature not available in <span class="productname">PostgreSQL</span>
 
85
</td>
 
86
</tr>
 
87
<tr>
 
88
<td><tt class="literal">action_statement</tt></td>
 
89
<td><tt class="type">character_data</tt></td>
 
90
<td>       Statement that is executed by the trigger (currently always
 
91
       <tt class="literal">EXECUTE PROCEDURE
 
92
       <i class="replaceable"><tt>function</tt></i>(...)</tt>)
 
93
      </td>
 
94
</tr>
 
95
<tr>
 
96
<td><tt class="literal">action_orientation</tt></td>
 
97
<td><tt class="type">character_data</tt></td>
 
98
<td>       Identifies whether the trigger fires once for each processed
 
99
       row or once for each statement (<tt class="literal">ROW</tt> or
 
100
       <tt class="literal">STATEMENT</tt>)
 
101
      </td>
 
102
</tr>
 
103
<tr>
 
104
<td><tt class="literal">condition_timing</tt></td>
 
105
<td><tt class="type">character_data</tt></td>
 
106
<td>       Time at which the trigger fires (<tt class="literal">BEFORE</tt> or
 
107
       <tt class="literal">AFTER</tt>)
 
108
      </td>
 
109
</tr>
 
110
<tr>
 
111
<td><tt class="literal">condition_reference_old_table</tt></td>
 
112
<td><tt class="type">sql_identifier</tt></td>
 
113
<td>Applies to a feature not available in <span class="productname">PostgreSQL</span>
 
114
</td>
 
115
</tr>
 
116
<tr>
 
117
<td><tt class="literal">condition_reference_new_table</tt></td>
 
118
<td><tt class="type">sql_identifier</tt></td>
 
119
<td>Applies to a feature not available in <span class="productname">PostgreSQL</span>
 
120
</td>
 
121
</tr>
 
122
</tbody>
 
123
</table>
 
124
</div>
 
125
<p>   Triggers in <span class="productname">PostgreSQL</span> have two
 
126
   incompatibilities with the SQL standard that affect the
 
127
   representation in the information schema.  First, trigger names are
 
128
   local to the table in <span class="productname">PostgreSQL</span>, rather
 
129
   than independent schema objects.  Therefore there may be duplicate
 
130
   trigger names defined in one schema, as long as they belong to
 
131
   different tables.  (<tt class="literal">trigger_catalog</tt> and
 
132
   <tt class="literal">trigger_schema</tt> are really the values pertaining
 
133
   to the table that the trigger is defined on.)  Second, triggers can
 
134
   be defined to fire on multiple events in
 
135
   <span class="productname">PostgreSQL</span> (e.g., <tt class="literal">ON INSERT OR
 
136
   UPDATE</tt>), whereas the SQL standard only allows one.  If a
 
137
   trigger is defined to fire on multiple events, it is represented as
 
138
   multiple rows in the information schema, one for each type of
 
139
   event.  As a consequence of these two issues, the primary key of
 
140
   the view <tt class="literal">triggers</tt> is really
 
141
   <tt class="literal">(trigger_catalog, trigger_schema, trigger_name,
 
142
   event_object_name, event_manipulation)</tt> instead of
 
143
   <tt class="literal">(trigger_catalog, trigger_schema, trigger_name)</tt>,
 
144
   which is what the SQL standard specifies.  Nonetheless, if you
 
145
   define your triggers in a manner that conforms with the SQL
 
146
   standard (trigger names unique in the schema and only one event
 
147
   type per trigger), this will not affect you.
 
148
  </p>
 
149
</div></body>
 
150
</html>