From: Thomas G. Lockhart Date: Fri, 4 Jun 1999 15:50:44 +0000 (+0000) Subject: Add input parameters for LOCK TABLE. Still needs explanation from Vadim. X-Git-Tag: REL6_5~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ebfbb79f25b6394fab47d3a272bff1549c1031de;p=postgresql Add input parameters for LOCK TABLE. Still needs explanation from Vadim. Fix markup. --- diff --git a/doc/src/sgml/ref/lock.sgml b/doc/src/sgml/ref/lock.sgml index eb3ad5fc53..02245c1bfa 100644 --- a/doc/src/sgml/ref/lock.sgml +++ b/doc/src/sgml/ref/lock.sgml @@ -1,84 +1,156 @@ - - - + + + LOCK - - SQL - Language Statements - - - + + SQL - Language Statements + + + LOCK - - + + Explicit lock of a table inside a transaction - + - - - 1998-09-24 - - - LOCK [ TABLE ] [IN [ROW|ACCESS] [SHARE|EXCLUSIVE] | [SHARE ROW EXCLUSIVE] MODE] - table - + + + 1998-09-24 + + +LOCK [ TABLE ] table +LOCK [ TABLE ] table IN [ ROW | ACCESS ] { SHARE | EXCLUSIVE } MODE +LOCK [ TABLE ] table IN SHARE ROW EXCLUSIVE MODE + - - - 1998-09-01 - - + <refsect2 id="R2-SQL-LOCK-1"> + <refsect2info> + <date>1998-09-01</date> + </refsect2info> + <title> Inputs - - - - - - - table - - - - The name of an existing table to lock. - - - - - - + + + + + + + table + + + + The name of an existing table to lock. + + + + + + + SHARE MODE + + + + + + + + + + EXCLUSIVE MODE + + + + + + + + + + ROW SHARE MODE + + + + + + + + + + ROW EXCLUSIVE MODE + + + + + + - - - 1998-09-24 - - + <varlistentry> + <term> + ACCESS SHARE MODE + </term> + <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 - - + + - - - ERROR table: Table does not exist. - - - - Message returned if table + + + + ERROR table: Table does not exist. + + + + Message returned if table does not exist. - + - - + + - - - 1998-09-24 - - + <refsect1 id="R1-SQL-LOCK-1"> + <refsect1info> + <date>1998-09-24</date> + </refsect1info> + <title> Description - - + + By default, LOCK locks in exclusive mode a table inside a transaction. Various options allow shared access, or row-level locking control. The classic use for this is @@ -112,13 +184,13 @@ - - - 1998-09-24 - - + <refsect2 id="R2-SQL-LOCK-3"> + <refsect2info> + <date>1998-09-24</date> + </refsect2info> + <title> Notes - + LOCK is a Postgres language extension. @@ -134,16 +206,16 @@ - + - - + <refsect1 id="R1-SQL-LOCK-2"> + <title> Usage - - - - + + + + --Explicit locking to prevent deadlock: -- BEGIN WORK; @@ -152,30 +224,30 @@ UPDATE films SET len = INTERVAL '100 minute' WHERE len = INTERVAL '117 minute'; COMMIT WORK; - + - + - - + <refsect1 id="R1-SQL-LOCK-3"> + <title> Compatibility - + - - - 1998-09-24 - - + <refsect2 id="R2-SQL-LOCK-4"> + <refsect2info> + <date>1998-09-24</date> + </refsect2info> + <title> SQL92 - - + + There is no LOCK TABLE in SQL92, which instead uses SET TRANSACTION to specify concurrency level on transactions. We support that too. - +