Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
4d65d287
Commit
4d65d287
authored
16 years ago
by
Bruce Momjian
Browse files
Options
Downloads
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
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/ref/select.sgml
+18
-3
18 additions, 3 deletions
doc/src/sgml/ref/select.sgml
with
18 additions
and
3 deletions
doc/src/sgml/ref/select.sgml
+
18
−
3
View file @
4d65d287
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.11
8
2009/01/2
2 20:15:59 tgl
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.11
9
2009/01/2
3 14:05:28 momjian
Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -1167,12 +1167,27 @@ ROLLBACK TO s;
...
@@ -1167,12 +1167,27 @@ ROLLBACK TO s;
clauses to return fewer rows than specified by <literal>LIMIT</literal>.
clauses to return fewer rows than specified by <literal>LIMIT</literal>.
This is because <literal>LIMIT</> is applied first. The command
This is because <literal>LIMIT</> is applied first. The command
selects the specified number of rows,
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
Once the <literal>SELECT</> unblocks, the row might have been deleted
or updated so that it does not meet the query <literal>WHERE</> condition
or updated so that it does not meet the query <literal>WHERE</> condition
anymore, in which case it will not be returned.
anymore, in which case it will not be returned.
</para>
</para>
</caution>
</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>
<refsect2 id="SQL-TABLE">
<refsect2 id="SQL-TABLE">
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment