11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/ref/lock.sgml,v 1.14 1999/10/01 15:26:29 thomas Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/lock.sgml,v 1.15 2000/03/23 21:38:57 momjian Exp $
33Postgres documentation
44-->
55
@@ -32,6 +32,70 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
3232 <refsect2info>
3333 <date>1999-06-09</date>
3434 </refsect2info>
35+
36+ <title>
37+ Terms
38+ </title>
39+ <para>
40+ <variablelist>
41+ <varlistentry>
42+ <term>EXCLUSIVE</term>
43+ <listitem>
44+ <para>
45+ Exclusive lock that prevents other locks from being granted.
46+ </para>
47+ </listitem>
48+ </varlistentry>
49+ </variablelist>
50+
51+ <variablelist>
52+ <varlistentry>
53+ <term>SHARE</term>
54+ <listitem>
55+ <para>
56+ Allows others to share lock. Prevents EXCLUSIVE locks.
57+ </para>
58+ </listitem>
59+ </varlistentry>
60+ </variablelist>
61+
62+ <variablelist>
63+ <varlistentry>
64+ <term>ACCESS</term>
65+ <listitem>
66+ <para>
67+ Locks table schema.
68+ </para>
69+ </listitem>
70+ </varlistentry>
71+ </variablelist>
72+
73+ <variablelist>
74+ <varlistentry>
75+ <term>ROW</term>
76+ <listitem>
77+ <para>
78+ Locks individual rows.
79+ </para>
80+ </listitem>
81+ </varlistentry>
82+ </variablelist>
83+
84+ <variablelist>
85+ <varlistentry>
86+ <term>Notes</term>
87+ <listitem>
88+ <para>
89+ If EXCLUSIVE or SHARE are not speicified, EXCLUSIVE is assumed.
90+ If ROW or ACCESS is not specified, the entire table is locked
91+ for the duration of the transaction.
92+ </para>
93+ </listitem>
94+ </varlistentry>
95+ </variablelist>
96+
97+ </para>
98+
3599 <title>
36100 Inputs
37101 </title>
@@ -53,17 +117,17 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
53117 <note>
54118<para>
55119 This lock mode is acquired automatically over tables being queried.
56- <productname>Postgres</productname> releases automaticallyacquired
57- ACCESS SHARE locks after thestatement is done .
120+ This lock is released automaticallyafter the statement completes.
121+ It does not remain for theduration of the transaction .
58122</para>
59123 </note>
60124
61125 <para>
62126This is the least restrictive lock mode which conflicts only with
63127ACCESS EXCLUSIVE mode. It is intended to protect a table being
64- queried from concurrent <command>ALTER TABLE</command>,
128+ modified by concurrent <command>ALTER TABLE</command>,
65129<command>DROP TABLE</command> and <command>VACUUM</command>
66- statements over the same table .
130+ commands .
67131 </para>
68132 </listitem>
69133 </varlistentry>
@@ -74,6 +138,8 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
74138 <note>
75139 <para>
76140 Automatically acquired by any <command>SELECT FOR UPDATE</command> statement.
141+ While it is a SHARE lock, there is the intention to later upgrade
142+ this to an EXCLUSIVE lock.
77143</para>
78144 </note>
79145
@@ -90,7 +156,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
90156<para>
91157 Automatically acquired by any <command>UPDATE</command>,
92158 <command>DELETE</command>, <command>INSERT</command> statement.
93- </para>
159+ </para>
94160 </note>
95161
96162 <para>
@@ -107,6 +173,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
107173 <note>
108174 <para>
109175 Automatically acquired by any <command>CREATE INDEX</command> statement.
176+ Share-locks entire table.
110177 </para>
111178 </note>
112179
@@ -123,10 +190,10 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
123190 <listitem>
124191
125192 <para>
126- Conflicts with ROW EXCLUSIVE, SHARE, SHARE ROWEXCLUSIVE,
127- EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is more
128- restrictive than SHARE mode because of only one transaction
129- at time can hold this lock .
193+ This is like an EXCLUSIVE lock, but allows SHARE ROWlocks
194+ by others.
195+ Conflicts with ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
196+ EXCLUSIVE and ACCESS EXCLUSIVE modes .
130197 </para>
131198 </listitem>
132199 </varlistentry>
@@ -139,7 +206,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
139206Conflicts with ROW SHARE, ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
140207EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is yet more
141208restrictive than that of SHARE ROW EXCLUSIVE; it blocks all concurrent
142- SELECT FOR UPDATE queries.
209+ SHARE ROW/ SELECT FOR UPDATE queries.
143210 </para>
144211 </listitem>
145212 </varlistentry>
@@ -149,7 +216,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">name</replaceable> IN SHARE ROW EX
149216 <listitem>
150217 <note>
151218<para>
152- Automatically acquired by <command>ALTER TABLE</command>,
219+ Automatically acquired by <command>ALTER TABLE</command>,
153220 <command>DROP TABLE</command>, <command>VACUUM</command> statements.
154221</para>
155222 </note>