diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 0f9d52753d..1d3f854b64 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -1200,7 +1200,7 @@ FETCH { FIRST | NEXT } [ count ] { - <literal>FOR UPDATE</>, <literal>FOR NO KEY UPDATE</>/<literal>FOR SHARE</>/<literal>FOR KEY SHARE</> Clauses + The Locking Clause FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE @@ -1210,30 +1210,19 @@ FETCH { FIRST | NEXT } [ count ] { - The FOR UPDATE clause has this form: - -FOR UPDATE [ OF table_name [, ...] ] [ NOWAIT ] - - + The locking clause has the general form - - The FOR NO KEY UPDATE clause has this form: -FOR NO KEY UPDATE [ OF table_name [, ...] ] [ NOWAIT ] +FOR lock_strength [ OF table_name [, ...] ] [ NOWAIT ] - - - The closely related FOR SHARE clause has this form: - -FOR SHARE [ OF table_name [, ...] ] [ NOWAIT ] - - + where lock_strength can be one of - - Similarly, the FOR KEY SHARE clause has this form: -FOR KEY SHARE [ OF table_name [, ...] ] [ NOWAIT ] +UPDATE +NO KEY UPDATE +SHARE +KEY SHARE @@ -1245,6 +1234,7 @@ FOR KEY SHARE [ OF table_name [, .. other transactions that attempt UPDATE, DELETE, SELECT FOR UPDATE, + SELECT FOR NO KEY UPDATE, SELECT FOR SHARE or SELECT FOR KEY SHARE of these rows will be blocked until the current transaction ends. @@ -1270,15 +1260,17 @@ FOR KEY SHARE [ OF table_name [, .. FOR NO KEY UPDATE behaves similarly, except that the lock acquired is weaker: this lock will not block 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 + UPDATE that does not acquire a FOR UPDATE lock. FOR SHARE behaves similarly, except that it acquires a shared rather than exclusive lock on each retrieved row. A shared lock blocks other transactions from performing - UPDATE, DELETE, or SELECT - FOR UPDATE on these rows, but it does not prevent them + UPDATE, DELETE, SELECT + FOR UPDATE or SELECT FOR NO KEY UPDATE + on these rows, but it does not prevent them from performing SELECT FOR SHARE or SELECT FOR KEY SHARE. @@ -1290,8 +1282,8 @@ FOR KEY SHARE [ OF table_name [, .. not SELECT FOR NO KEY UPDATE. A key-shared lock blocks other transactions from performing DELETE or any UPDATE that changes the key values, but not - other UPDATE, and neither it does prevent - SELECT FOR UPDATE, SELECT FOR SHARE, or + other UPDATE, and neither does it prevent + SELECT FOR NO KEY UPDATE, SELECT FOR SHARE, or SELECT FOR KEY SHARE. @@ -1382,7 +1374,7 @@ UPDATE mytable SET ... WHERE key = 1; ROLLBACK TO s; would fail to preserve the FOR UPDATE lock after the - ROLLBACK. This has been fixed in release 9.2. + ROLLBACK TO. This has been fixed in release 9.3.