Skip to content

Commit d76f279

Browse files
committed
Remove pre-7.3 mention that FOR UPDATE can be before LIMIT.
Document that FOR UPDATE and LIMIT together can return fewer rows that LIMIT specifies, and why.
1 parent 26bb65d commit d76f279

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/src/sgml/ref/select.sgml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.83 2005/04/08 00:59:58 neilc Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.84 2005/04/22 04:20:44 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -830,11 +830,13 @@ FOR UPDATE [ OF <replaceable class="parameter">table_name</replaceable> [, ...]
830830
</para>
831831

832832
<para>
833-
<literal>FOR UPDATE</literal> may appear before
834-
<literal>LIMIT</literal> for compatibility with
835-
<productname>PostgreSQL</productname> versions before 7.3. It
836-
effectively executes after <literal>LIMIT</literal>, however, and
837-
so that is the recommended place to write it.
833+
It is possible for a <command>SELECT</> command using both
834+
<literal>LIMIT</literal> and <literal>FOR UPDATE</literal>
835+
clauses to return fewer rows than specified by <literal>LIMIT</literal>.
836+
This is because <literal>LIMIT</> selects a number of rows,
837+
but might then block requesting a <literal>FOR UPDATE</literal> lock.
838+
Once the <literal>SELECT</> unblocks, the query qualifiation might not
839+
be met and the row not be returned by <literal>SELECT</>.
838840
</para>
839841
</refsect2>
840842
</refsect1>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy