Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fe9c442

Browse files
author
Neil Conway
committed
Improve documentation for the newly-added NOWAIT clause of LOCK TABLE.
1 parent bfd6f52 commit fe9c442

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

doc/src/sgml/ref/lock.sgml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/lock.sgml,v 1.41 2004/03/11 01:47:35 ishii Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/lock.sgml,v 1.42 2004/03/12 00:52:23 neilc Exp $
33
PostgreSQL documentation
44
-->
55

@@ -33,13 +33,15 @@ where <replaceable class="PARAMETER">lockmode</replaceable> is one of:
3333
<title>Description</title>
3434

3535
<para>
36-
<command>LOCK TABLE</command> obtains a table-level lock, waiting if
37-
necessary for any conflicting locks to be released.
38-
If <literal>NOWAIT</literal> is given, <command>LOCK TABLE</command>
39-
does not wait for acquiring lock, and throws an error instead.
40-
Once obtained, the lock is held for the remainder of the current transaction.
41-
(There is no <command>UNLOCK TABLE</command> command; locks are always
42-
released at transaction end.)
36+
<command>LOCK TABLE</command> obtains a table-level lock, waiting
37+
if necessary for any conflicting locks to be released. If
38+
<literal>NOWAIT</literal> is specified, <command>LOCK
39+
TABLE</command> does not wait to acquire the desired lock: if it
40+
cannot be immediately acquired, the transaction is aborted and an
41+
error is emitted. Once obtained, the lock is held for the
42+
remainder of the current transaction. (There is no <command>UNLOCK
43+
TABLE</command> command; locks are always released at transaction
44+
end.)
4345
</para>
4446

4547
<para>
@@ -132,6 +134,18 @@ where <replaceable class="PARAMETER">lockmode</replaceable> is one of:
132134
</para>
133135
</listitem>
134136
</varlistentry>
137+
138+
<varlistentry>
139+
<term><literal>NOWAIT</literal></term>
140+
<listitem>
141+
<para>
142+
Specifies that <command>LOCK TABLE</command> should not wait for
143+
any conflicting locks to be released: if the specified lock
144+
cannot be immediately acquired without waiting, the transaction
145+
is aborted.
146+
</para>
147+
</listitem>
148+
</varlistentry>
135149
</variablelist>
136150
</refsect1>
137151

0 commit comments

Comments
 (0)