Commit ebfbb79f authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Add input parameters for LOCK TABLE. Still needs explanation from Vadim.

Fix markup.
parent 39fc8139
<REFENTRY ID="SQL-LOCK"> <refentry id="SQL-LOCK">
<REFMETA> <refmeta>
<REFENTRYTITLE> <refentrytitle>
LOCK LOCK
</REFENTRYTITLE> </refentrytitle>
<REFMISCINFO>SQL - Language Statements</REFMISCINFO> <refmiscinfo>SQL - Language Statements</refmiscinfo>
</REFMETA> </refmeta>
<REFNAMEDIV> <refnamediv>
<REFNAME> <refname>
LOCK LOCK
</REFNAME> </refname>
<REFPURPOSE> <refpurpose>
Explicit lock of a table inside a transaction Explicit lock of a table inside a transaction
</REFPURPOSE> </refpurpose>
</refnamediv> </refnamediv>
<REFSYNOPSISDIV> <refsynopsisdiv>
<REFSYNOPSISDIVINFO> <refsynopsisdivinfo>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSYNOPSISDIVINFO> </refsynopsisdivinfo>
<SYNOPSIS> <synopsis>
LOCK [ TABLE ] [IN [ROW|ACCESS] [SHARE|EXCLUSIVE] | [SHARE ROW EXCLUSIVE] MODE] LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable>
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN [ ROW | ACCESS ] { SHARE | EXCLUSIVE } MODE
</SYNOPSIS> LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW EXCLUSIVE MODE
</synopsis>
<REFSECT2 ID="R2-SQL-LOCK-1"> <refsect2 id="R2-SQL-LOCK-1">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-01</DATE> <date>1998-09-01</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
Inputs Inputs
</TITLE> </title>
<PARA> <para>
</PARA>
<VARIABLELIST> <variablelist>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> <replaceable class="PARAMETER">table</replaceable>
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
The name of an existing table to lock. The name of an existing table to lock.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</VARIABLELIST>
<varlistentry>
</REFSECT2> <term>
SHARE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
ROW SHARE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
ROW EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<REFSECT2 ID="R2-SQL-LOCK-2"> <varlistentry>
<REFSECT2INFO> <term>
<DATE>1998-09-24</DATE> ACCESS SHARE MODE
</REFSECT2INFO> </term>
<TITLE> <listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
ACCESS EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
SHARE ROW EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>
<refsect2 id="R2-SQL-LOCK-2">
<refsect2info>
<date>1998-09-24</date>
</refsect2info>
<title>
Outputs Outputs
</TITLE> </title>
<PARA> <para>
<VARIABLELIST> <variablelist>
<TERM> <varlistentry>
ERROR <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>: Table does not exist. <term>
</TERM> ERROR <replaceable class="PARAMETER">table</replaceable>: Table does not exist.
<LISTITEM> </term>
<PARA> <listitem>
Message returned if <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> <para>
Message returned if <replaceable class="PARAMETER">table</replaceable>
does not exist. does not exist.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</VARIABLELIST> </variablelist>
</para> </para>
</REFSECT2> </refsect2>
</REFSYNOPSISDIV> </refsynopsisdiv>
<REFSECT1 ID="R1-SQL-LOCK-1"> <refsect1 id="R1-SQL-LOCK-1">
<REFSECT1INFO> <refsect1info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT1INFO> </refsect1info>
<TITLE> <title>
Description Description
</TITLE> </title>
<PARA> <para>
By default, <command>LOCK</command> locks in exclusive mode a table inside By default, <command>LOCK</command> locks in exclusive mode a table inside
a transaction. Various options allow shared access, or row-level locking a transaction. Various options allow shared access, or row-level locking
control. The classic use for this is control. The classic use for this is
...@@ -112,13 +184,13 @@ ...@@ -112,13 +184,13 @@
</para> </para>
</note> </note>
<REFSECT2 ID="R2-SQL-LOCK-3"> <refsect2 id="R2-SQL-LOCK-3">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
Notes Notes
</TITLE> </title>
<para> <para>
<command>LOCK</command> is a <productname>Postgres</productname> <command>LOCK</command> is a <productname>Postgres</productname>
language extension. language extension.
...@@ -134,16 +206,16 @@ ...@@ -134,16 +206,16 @@
</para> </para>
</note> </note>
</para> </para>
</REFSECT2> </refsect2>
</refsect1> </refsect1>
<REFSECT1 ID="R1-SQL-LOCK-2"> <refsect1 id="R1-SQL-LOCK-2">
<TITLE> <title>
Usage Usage
</TITLE> </title>
<PARA> <para>
</PARA> </para>
<ProgramListing> <programlisting>
--Explicit locking to prevent deadlock: --Explicit locking to prevent deadlock:
-- --
BEGIN WORK; BEGIN WORK;
...@@ -152,30 +224,30 @@ ...@@ -152,30 +224,30 @@
UPDATE films SET len = INTERVAL '100 minute' UPDATE films SET len = INTERVAL '100 minute'
WHERE len = INTERVAL '117 minute'; WHERE len = INTERVAL '117 minute';
COMMIT WORK; COMMIT WORK;
</ProgramListing> </programlisting>
</REFSECT1> </refsect1>
<REFSECT1 ID="R1-SQL-LOCK-3"> <refsect1 id="R1-SQL-LOCK-3">
<TITLE> <title>
Compatibility Compatibility
</TITLE> </title>
<REFSECT2 ID="R2-SQL-LOCK-4"> <refsect2 id="R2-SQL-LOCK-4">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
SQL92 SQL92
</TITLE> </title>
<PARA> <para>
There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>, There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>,
which instead uses <command>SET TRANSACTION</command> to specify which instead uses <command>SET TRANSACTION</command> to specify
concurrency level on transactions. We support that too. concurrency level on transactions. We support that too.
</para> </para>
</refsect2> </refsect2>
</refsect1> </refsect1>
</REFENTRY> </refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment