Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fb9bc342
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fb9bc342
编写于
10月 18, 2002
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve discussion of FOR UPDATE.
上级
f99e525f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
7 deletion
+21
-7
doc/src/sgml/ref/select.sgml
doc/src/sgml/ref/select.sgml
+21
-7
未找到文件。
doc/src/sgml/ref/select.sgml
浏览文件 @
fb9bc342
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.6
1 2002/09/21 18:32:54 petere
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.6
2 2002/10/18 18:26:22 tgl
Exp $
PostgreSQL documentation
-->
...
...
@@ -368,13 +368,14 @@ where <replaceable class="PARAMETER">from_item</replaceable> can be:
</para>
<para>
The FOR UPDATE clause
allows the SELECT statement to perform
exclusive locking of selected row
s.
The FOR UPDATE clause
causes the SELECT statement to lock the selected
rows against concurrent update
s.
</para>
<para>
You must have SELECT privilege to a table to read its values
(See the <command>GRANT</command>/<command>REVOKE</command> statements).
Use of FOR UPDATE requires UPDATE privilege as well.
</para>
<refsect2 id="SQL-FROM">
...
...
@@ -859,19 +860,32 @@ SELECT name FROM distributors ORDER BY code;
<para>
FOR UPDATE causes the rows retrieved by the query to be locked as though
for update. This prevents them from being modified or deleted by other
transactions until the current transaction ends.
transactions until the current transaction ends; that is, other
transactions that attempt UPDATE, DELETE, or SELECT FOR UPDATE of these
rows will be blocked until the current transaction ends. Also, if an
UPDATE, DELETE, or SELECT FOR UPDATE from another transaction has already
locked a selected row or rows, SELECT FOR UPDATE will wait for the other
transaction to complete, and will then lock and return the updated row
(or no row, if the row was deleted). For further discussion see the
concurrency chapter of the <citetitle>User's Guide</citetitle>.
</para>
<para>
If specific tables are named in FOR UPDATE, then only rows coming from
those tables are locked.
those tables are locked; any other tables used in the SELECT are simply
read as usual.
</para>
<para>
FOR UPDATE cannot be used in contexts where returned rows can't be clearly
identified with individual table rows; for example it can't be used with
aggregation. FOR UPDATE may also appear before LIMIT for portability with
pre-7.3 applications.
aggregation.
</para>
<para>
FOR UPDATE may appear before LIMIT for compatibility with
pre-7.3 applications. However, it effectively executes after LIMIT,
and so that is the recommended place to write it.
</para>
</refsect2>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录