Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit52831f7

Browse files
committed
Update to CREATE CONSTRAINT manual page.
Michael Glaesemann
1 parentc2e7da1 commit52831f7

File tree

1 file changed

+95
-68
lines changed

1 file changed

+95
-68
lines changed
Lines changed: 95 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_constraint.sgml,v 1.14 2006/09/1600:30:17 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_constraint.sgml,v 1.15 2006/10/1619:30:09 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -21,9 +21,12 @@ PostgreSQL documentation
2121
<refsynopsisdiv>
2222
<synopsis>
2323
CREATE CONSTRAINT TRIGGER <replaceable class="parameter">name</replaceable>
24-
AFTER <replaceable class="parameter">events</replaceable> ON
25-
<replaceable class="parameter">tablename</replaceable> <replaceable class="parameter">constraint</replaceable> <replaceable class="parameter">attributes</replaceable>
26-
FOR EACH ROW EXECUTE PROCEDURE <replaceable class="parameter">funcname</replaceable> ( <replaceable class="parameter">args</replaceable> )
24+
AFTER <replaceable class="parameter">event [ OR ... ]</replaceable>
25+
ON <replaceable class="parameter">table_name</replaceable>
26+
[ FROM <replaceable class="parameter">referenced_table_name</replaceable> ]
27+
{ NOT DEFERRABLE | [ DEFERABBLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }
28+
FOR EACH ROW
29+
EXECUTE PROCEDURE <replaceable class="parameter">funcname</replaceable> ( <replaceable class="parameter">arguments</replaceable> )
2730
</synopsis>
2831
</refsynopsisdiv>
2932

@@ -33,70 +36,94 @@ CREATE CONSTRAINT TRIGGER <replaceable class="parameter">name</replaceable>
3336
<para>
3437
<command>CREATE CONSTRAINT TRIGGER</command> is used within
3538
<command>CREATE TABLE</command>/<command>ALTER TABLE</command> and by
36-
<application>pg_dump</application> to create the special triggers for
37-
referential integrity.
38-
It is not intended for general use.
39-
</para>
40-
</refsect1>
39+
<application>pg_dump</application> to create the special triggers for
40+
referential integrity.
41+
It is not intended for general use.
42+
</para>
43+
</refsect1>
44+
45+
<refsect1>
46+
<title>Parameters</title>
47+
48+
<variablelist>
49+
<varlistentry>
50+
<term><replaceable class="PARAMETER">name</replaceable></term>
51+
<listitem>
52+
<para>
53+
The name of the constraint trigger. The actual name of the
54+
created trigger will be of the form
55+
<literal>RI_ConstraintTrigger_0000<literal> (where 0000 is some number
56+
assigned by the server).
57+
Use this assigned name is when dropping the constraint.
58+
</para>
59+
</listitem>
60+
</varlistentry>
61+
62+
<varlistentry>
63+
<term><replaceable class="PARAMETER">events</replaceable></term>
64+
<listitem>
65+
<para>
66+
One of <literal>INSERT</literal>, <literal>UPDATE</literal>, or
67+
<literal>DELETE</literal>; this specifies the event that will fire the
68+
trigger. Multiple events can be specified using <literal>OR<literal>.
69+
</para>
70+
</listitem>
71+
</varlistentry>
72+
73+
<varlistentry>
74+
<term><replaceable class="PARAMETER">table_name</replaceable></term>
75+
<listitem>
76+
<para>
77+
The (possibly schema-qualified) name of the table in which
78+
the triggering events occur.
79+
</para>
80+
</listitem>
81+
</varlistentry>
82+
83+
<varlistentry>
84+
<term><replaceable class="PARAMETER">referenced_table_name</replaceable></term>
85+
<listitem>
86+
<para>
87+
The (possibly schema-qualified) name of the table referenced by the
88+
constraint. Used by foreign key constraints triggers.
89+
</para>
90+
</listitem>
91+
</varlistentry>
92+
93+
<varlistentry>
94+
<term><literal>DEFERRABLE</literal></term>
95+
<term><literal>NOT DEFERRABLE</literal></term>
96+
<term><literal>INITIALLY IMMEDIATE</literal></term>
97+
<term><literal>INITIALLY DEFERRED</literal></term>
98+
<listitem>
99+
<para>
100+
See the <xref linkend="SQL-CREATETABLE" endterm="SQL-CREATETABLE-TITLE">
101+
documentation for details of these constraint options.
102+
</para>
103+
</listitem>
104+
</varlistentry>
105+
106+
<varlistentry>
107+
<term><replaceable class="PARAMETER">funcname</replaceable>(<replaceable class="PARAMETER">args</replaceable>)</term>
108+
<listitem>
109+
<para>
110+
The function to call as part of the trigger processing. See <xref
111+
linkend="SQL-CREATETRIGGER" endterm="SQL-CREATETRIGGER-TITLE"> for
112+
details.
113+
</para>
114+
</listitem>
115+
</varlistentry>
116+
</variablelist>
117+
</refsect1>
41118

42119
<refsect1>
43-
<title>Parameters</title>
44-
45-
<variablelist>
46-
<varlistentry>
47-
<term><replaceable class="PARAMETER">name</replaceable></term>
48-
<listitem>
49-
<para>
50-
The name of the constraint trigger.
51-
</para>
52-
</listitem>
53-
</varlistentry>
54-
55-
<varlistentry>
56-
<term><replaceable class="PARAMETER">events</replaceable></term>
57-
<listitem>
58-
<para>
59-
The event categories for which this trigger should be fired.
60-
</para>
61-
</listitem>
62-
</varlistentry>
63-
64-
<varlistentry>
65-
<term><replaceable class="PARAMETER">tablename</replaceable></term>
66-
<listitem>
67-
<para>
68-
The name (possibly schema-qualified) of the table in which
69-
the triggering events occur.
70-
</para>
71-
</listitem>
72-
</varlistentry>
73-
74-
<varlistentry>
75-
<term><replaceable class="PARAMETER">constraint</replaceable></term>
76-
<listitem>
77-
<para>
78-
Actual constraint specification.
79-
</para>
80-
</listitem>
81-
</varlistentry>
82-
83-
<varlistentry>
84-
<term><replaceable class="PARAMETER">attributes</replaceable></term>
85-
<listitem>
86-
<para>
87-
The constraint attributes.
88-
</para>
89-
</listitem>
90-
</varlistentry>
91-
92-
<varlistentry>
93-
<term><replaceable class="PARAMETER">funcname</replaceable>(<replaceable class="PARAMETER">args</replaceable>)</term>
94-
<listitem>
95-
<para>
96-
The function to call as part of the trigger processing.
97-
</para>
98-
</listitem>
99-
</varlistentry>
100-
</variablelist>
120+
<title>Compatibility</title>
121+
<para>
122+
<command>CREATE CONTRAINT TRIGGER</command> is a
123+
<productname>PostgreSQL</productname> extension of the <acronym>SQL</>
124+
standard.
125+
</para>
101126
</refsect1>
102-
</refentry>
127+
128+
</refentry>
129+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp