Fix orthotypographical mistake
Apparently I lost some of the edits I had done on this page for commit 0ac5ad5134. Per note from Etsuro Fujita, although I didn't use his patch. Make some of the wording in the affected section a bit more complete, too.
This commit is contained in:
parent
0247d43dd9
commit
1ba0119308
@ -1200,7 +1200,7 @@ FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] {
|
|||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<refsect2 id="SQL-FOR-UPDATE-SHARE">
|
<refsect2 id="SQL-FOR-UPDATE-SHARE">
|
||||||
<title id="sql-for-update-share-title"><literal>FOR UPDATE</>, <literal>FOR NO KEY UPDATE</>/<literal>FOR SHARE</>/<literal>FOR KEY SHARE</> Clauses</title>
|
<title id="sql-for-update-share-title">The Locking Clause</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<literal>FOR UPDATE</>, <literal>FOR NO KEY UPDATE</>, <literal>FOR SHARE</>
|
<literal>FOR UPDATE</>, <literal>FOR NO KEY UPDATE</>, <literal>FOR SHARE</>
|
||||||
@ -1210,30 +1210,19 @@ FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] {
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <literal>FOR UPDATE</literal> clause has this form:
|
The locking clause has the general form
|
||||||
<synopsis>
|
|
||||||
FOR UPDATE [ OF <replaceable class="parameter">table_name</replaceable> [, ...] ] [ NOWAIT ]
|
|
||||||
</synopsis>
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
The <literal>FOR NO KEY UPDATE</literal> clause has this form:
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
FOR NO KEY UPDATE [ OF <replaceable class="parameter">table_name</replaceable> [, ...] ] [ NOWAIT ]
|
FOR <replaceable>lock_strength</> [ OF <replaceable class="parameter">table_name</replaceable> [, ...] ] [ NOWAIT ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
where <replaceable>lock_strength</> can be one of
|
||||||
The closely related <literal>FOR SHARE</literal> clause has this form:
|
|
||||||
<synopsis>
|
|
||||||
FOR SHARE [ OF <replaceable class="parameter">table_name</replaceable> [, ...] ] [ NOWAIT ]
|
|
||||||
</synopsis>
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Similarly, the <literal>FOR KEY SHARE</> clause has this form:
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
FOR KEY SHARE [ OF <replaceable class="parameter">table_name</replaceable> [, ...] ] [ NOWAIT ]
|
UPDATE
|
||||||
|
NO KEY UPDATE
|
||||||
|
SHARE
|
||||||
|
KEY SHARE
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -1245,6 +1234,7 @@ FOR KEY SHARE [ OF <replaceable class="parameter">table_name</replaceable> [, ..
|
|||||||
other transactions that attempt <command>UPDATE</command>,
|
other transactions that attempt <command>UPDATE</command>,
|
||||||
<command>DELETE</command>,
|
<command>DELETE</command>,
|
||||||
<command>SELECT FOR UPDATE</command>,
|
<command>SELECT FOR UPDATE</command>,
|
||||||
|
<command>SELECT FOR NO KEY UPDATE</command>,
|
||||||
<command>SELECT FOR SHARE</command> or
|
<command>SELECT FOR SHARE</command> or
|
||||||
<command>SELECT FOR KEY SHARE</command>
|
<command>SELECT FOR KEY SHARE</command>
|
||||||
of these rows will be blocked until the current transaction ends.
|
of these rows will be blocked until the current transaction ends.
|
||||||
@ -1270,15 +1260,17 @@ FOR KEY SHARE [ OF <replaceable class="parameter">table_name</replaceable> [, ..
|
|||||||
<literal>FOR NO KEY UPDATE</> behaves similarly, except that the lock
|
<literal>FOR NO KEY UPDATE</> behaves similarly, except that the lock
|
||||||
acquired is weaker: this lock will not block
|
acquired is weaker: this lock will not block
|
||||||
<literal>SELECT FOR KEY SHARE</> commands that attempt to acquire
|
<literal>SELECT FOR KEY SHARE</> commands that attempt to acquire
|
||||||
a lock on the same rows.
|
a lock on the same rows. This lock mode is also acquired by any
|
||||||
|
<command>UPDATE</> that does not acquire a <literal>FOR UPDATE</> lock.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<literal>FOR SHARE</literal> behaves similarly, except that it
|
<literal>FOR SHARE</literal> behaves similarly, except that it
|
||||||
acquires a shared rather than exclusive lock on each retrieved
|
acquires a shared rather than exclusive lock on each retrieved
|
||||||
row. A shared lock blocks other transactions from performing
|
row. A shared lock blocks other transactions from performing
|
||||||
<command>UPDATE</command>, <command>DELETE</command>, or <command>SELECT
|
<command>UPDATE</command>, <command>DELETE</command>, <command>SELECT
|
||||||
FOR UPDATE</command> on these rows, but it does not prevent them
|
FOR UPDATE</command> or <command>SELECT FOR NO KEY UPDATE</>
|
||||||
|
on these rows, but it does not prevent them
|
||||||
from performing <command>SELECT FOR SHARE</command> or
|
from performing <command>SELECT FOR SHARE</command> or
|
||||||
<command>SELECT FOR KEY SHARE</command>.
|
<command>SELECT FOR KEY SHARE</command>.
|
||||||
</para>
|
</para>
|
||||||
@ -1290,8 +1282,8 @@ FOR KEY SHARE [ OF <replaceable class="parameter">table_name</replaceable> [, ..
|
|||||||
not <literal>SELECT FOR NO KEY UPDATE</>. A key-shared
|
not <literal>SELECT FOR NO KEY UPDATE</>. A key-shared
|
||||||
lock blocks other transactions from performing <command>DELETE</command>
|
lock blocks other transactions from performing <command>DELETE</command>
|
||||||
or any <command>UPDATE</command> that changes the key values, but not
|
or any <command>UPDATE</command> that changes the key values, but not
|
||||||
other <command>UPDATE</>, and neither it does prevent
|
other <command>UPDATE</>, and neither does it prevent
|
||||||
<command>SELECT FOR UPDATE</>, <command>SELECT FOR SHARE</>, or
|
<command>SELECT FOR NO KEY UPDATE</>, <command>SELECT FOR SHARE</>, or
|
||||||
<command>SELECT FOR KEY SHARE</>.
|
<command>SELECT FOR KEY SHARE</>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -1382,7 +1374,7 @@ UPDATE mytable SET ... WHERE key = 1;
|
|||||||
ROLLBACK TO s;
|
ROLLBACK TO s;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
would fail to preserve the <literal>FOR UPDATE</> lock after the
|
would fail to preserve the <literal>FOR UPDATE</> lock after the
|
||||||
<command>ROLLBACK</>. This has been fixed in release 9.2.
|
<command>ROLLBACK TO</>. This has been fixed in release 9.3.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<caution>
|
<caution>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user