Improve documentation for the newly-added NOWAIT clause of LOCK TABLE.

This commit is contained in:
Neil Conway 2004-03-12 00:52:23 +00:00
parent bfd6f52b0e
commit fe9c4420e4
1 changed files with 22 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/lock.sgml,v 1.41 2004/03/11 01:47:35 ishii Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/lock.sgml,v 1.42 2004/03/12 00:52:23 neilc Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
@ -33,13 +33,15 @@ where <replaceable class="PARAMETER">lockmode</replaceable> is one of:
<title>Description</title> <title>Description</title>
<para> <para>
<command>LOCK TABLE</command> obtains a table-level lock, waiting if <command>LOCK TABLE</command> obtains a table-level lock, waiting
necessary for any conflicting locks to be released. if necessary for any conflicting locks to be released. If
If <literal>NOWAIT</literal> is given, <command>LOCK TABLE</command> <literal>NOWAIT</literal> is specified, <command>LOCK
does not wait for acquiring lock, and throws an error instead. TABLE</command> does not wait to acquire the desired lock: if it
Once obtained, the lock is held for the remainder of the current transaction. cannot be immediately acquired, the transaction is aborted and an
(There is no <command>UNLOCK TABLE</command> command; locks are always error is emitted. Once obtained, the lock is held for the
released at transaction end.) remainder of the current transaction. (There is no <command>UNLOCK
TABLE</command> command; locks are always released at transaction
end.)
</para> </para>
<para> <para>
@ -132,6 +134,18 @@ where <replaceable class="PARAMETER">lockmode</replaceable> is one of:
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>NOWAIT</literal></term>
<listitem>
<para>
Specifies that <command>LOCK TABLE</command> should not wait for
any conflicting locks to be released: if the specified lock
cannot be immediately acquired without waiting, the transaction
is aborted.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>