Skip to content

Commit 27eba5d

Browse files
author
chegong18
committed
Update ref/create_trigger.sgml-200603
——row457至459,更新英文内容为: is mentioned as a target of the <command>UPDATE</command> command or if one of the listed columns is a generated column that depends on a column that is the target of the <command>UPDATE</command>. ——row467,更新中文内容为: 只有当至少一个被列出的列出现在<command>UPDATE</command>命令的更新目标中时,或者如果列出的列之一是生成的列,而且依赖的列是<command>UPDATE</command>的目标,该触发器才会触发。 ——row807,更新英文内容为: system columns of the <literal>NEW</literal> row (such as <literal>ctid</literal>), ——row812,更新中文内容为: 在一个<literal>BEFORE</literal>触发器中,<literal>WHEN</literal>条件正好在函数被或者将被执行之前被计算,因此使用<literal>WHEN</literal>与在触发器函数的开始测试同一个条件没有实质上的区别。特别注意该条件看到的<literal>NEW</literal>行是当前值,虽然可能已被早前的触发器所修改。还有,一个<literal>BEFORE</literal>触发器的<literal>WHEN</literal>条件不允许检查<literal>NEW</literal>行的系统列(例如<literal>ctid</literal>),因为那些列还没有被设置。
1 parent 428aa96 commit 27eba5d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

postgresql/doc/src/sgml/ref/create_trigger.sgml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ____________________________________________________________________________-->
2323
<primary>transition tables</primary>
2424
<seealso>ephemeral named relation</seealso>
2525
</indexterm>
26-
26+
2727
<!--==========================orignal english content==========================
2828
<refmeta>
2929
<refentrytitle>CREATE TRIGGER</refentrytitle>
@@ -454,15 +454,17 @@ ____________________________________________________________________________-->
454454
UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</replaceable> ... ]
455455
</synopsis>
456456
The trigger will only fire if at least one of the listed columns
457-
is mentioned as a target of the <command>UPDATE</command> command.
457+
is mentioned as a target of the <command>UPDATE</command> command
458+
or if one of the listed columns is a generated column that depends on a
459+
column that is the target of the <command>UPDATE</command>.
458460
</para>
459461
____________________________________________________________________________-->
460462
<para>
461463
对于<literal>UPDATE</literal>事件,可以使用下面的语法指定一个列的列表:
462464
<synopsis>
463465
UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</replaceable> ... ]
464466
</synopsis>
465-
只有当至少一个被列出的列出现在<command>UPDATE</command>命令的更新目标中时,该触发器才会触发。
467+
只有当至少一个被列出的列出现在<command>UPDATE</command>命令的更新目标中时,或者如果列出的列之一是生成的列,而且依赖的列是<command>UPDATE</command>的目标,该触发器才会触发。
466468
</para>
467469

468470
<!--==========================orignal english content==========================
@@ -802,12 +804,12 @@ ____________________________________________________________________________-->
802804
that the <literal>NEW</literal> row seen by the condition is the current value,
803805
as possibly modified by earlier triggers. Also, a <literal>BEFORE</literal>
804806
trigger's <literal>WHEN</literal> condition is not allowed to examine the
805-
system columns of the <literal>NEW</literal> row (such as <literal>oid</literal>),
807+
system columns of the <literal>NEW</literal> row (such as <literal>ctid</literal>),
806808
because those won't have been set yet.
807809
</para>
808810
____________________________________________________________________________-->
809811
<para>
810-
在一个<literal>BEFORE</literal>触发器中,<literal>WHEN</literal>条件正好在函数被或者将被执行之前被计算,因此使用<literal>WHEN</literal>与在触发器函数的开始测试同一个条件没有实质上的区别。特别注意该条件看到的<literal>NEW</literal>行是当前值,虽然可能已被早前的触发器所修改。还有,一个<literal>BEFORE</literal>触发器的<literal>WHEN</literal>条件不允许检查<literal>NEW</literal>行的系统列(例如<literal>oid</literal>),因为那些列还没有被设置。
812+
在一个<literal>BEFORE</literal>触发器中,<literal>WHEN</literal>条件正好在函数被或者将被执行之前被计算,因此使用<literal>WHEN</literal>与在触发器函数的开始测试同一个条件没有实质上的区别。特别注意该条件看到的<literal>NEW</literal>行是当前值,虽然可能已被早前的触发器所修改。还有,一个<literal>BEFORE</literal>触发器的<literal>WHEN</literal>条件不允许检查<literal>NEW</literal>行的系统列(例如<literal>ctid</literal>),因为那些列还没有被设置。
811813
</para>
812814

813815
<!--==========================orignal english content==========================
@@ -1100,7 +1102,7 @@ ____________________________________________________________________________-->
11001102
<title>Compatibility</title>
11011103
____________________________________________________________________________-->
11021104
<title>兼容性</title>
1103-
1105+
11041106
<!--
11051107
It's not clear whether SQL/MED contemplates triggers on foreign tables.
11061108
Its <drop basic column definition> General Rules do mention the possibility

0 commit comments

Comments
 (0)