- FOR UPDATE may appear before
- LIMIT for compatibility with
-
PostgreSQL versions before 7.3. It
- effectively executes after LIMIT, however, and
- so that is the recommended place to write it.
+ It is possible for a SELECT> command using both
+ LIMIT and FOR UPDATE
+ clauses to return fewer rows than specified by LIMIT.
+ This is because LIMIT> selects a number of rows,
+ but might then block requesting a FOR UPDATE lock.
+ Once the SELECT> unblocks, the query qualifiation might not
+ be met and the row not be returned by SELECT>.