Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4d65d287
Commit
4d65d287
authored
Jan 23, 2009
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document that SELECT ... ORDER BY .. FOR UPDATE/SHARE might return
results out of order because of locking, per bug report 4593
parent
3b35a904
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
doc/src/sgml/ref/select.sgml
doc/src/sgml/ref/select.sgml
+18
-3
No files found.
doc/src/sgml/ref/select.sgml
View file @
4d65d287
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.11
8 2009/01/22 20:15:59 tgl
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.11
9 2009/01/23 14:05:28 momjian
Exp $
PostgreSQL documentation
-->
...
...
@@ -1163,16 +1163,31 @@ ROLLBACK TO s;
<caution>
<para>
It is possible for a <command>SELECT</> command using both
<literal>LIMIT</literal> and
<literal>FOR UPDATE/SHARE</literal>
<literal>LIMIT</literal> and <literal>FOR UPDATE/SHARE</literal>
clauses to return fewer rows than specified by <literal>LIMIT</literal>.
This is because <literal>LIMIT</> is applied first. The command
selects the specified number of rows,
but might then block trying to obtain lock on one or more of them.
but might then block trying to obtain
a
lock on one or more of them.
Once the <literal>SELECT</> unblocks, the row might have been deleted
or updated so that it does not meet the query <literal>WHERE</> condition
anymore, in which case it will not be returned.
</para>
</caution>
<caution>
<para>
Similarly, it is possible for a <command>SELECT</> command
using <literal>ORDER BY</literal> and <literal>FOR
UPDATE/SHARE</literal> to return rows out of order. This is
because <literal>ORDER BY</> is applied first. The command
orders the result, but might then block trying to obtain a lock
on one or more of the rows. Once the <literal>SELECT</>
unblocks, one of the ordered columns might have been modified
and be returned out of order. A workaround is to perform
<command>SELECT ... FOR UPDATE/SHARE</> and then <command>SELECT
... ORDER BY</>.
</para>
</caution>
</refsect2>
<refsect2 id="SQL-TABLE">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment