Skip to content

Commit d80a6ed

Browse files
committed
校验 pltcl.sgml:
- 校对完成 待合并
1 parent 343b352 commit d80a6ed

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

postgresql/doc/src/sgml/pltcl.sgml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ ________________________________________________________-->
524524
<para>
525525
出于安全原因,PL/Tcl为每个SQL角色调用的函数在一个单独的Tcl解释器中执行。
526526
这可以防止一个用户意外或恶意干扰另一个用户的PL/Tcl函数行为。
527-
每个这样的解释器将有自己的值用于任何<quote>全局</quote>的Tcl变量。
527+
每个这样的解释器将有自己的值用于任何<quote>global</quote>的Tcl变量。
528528
因此,只有当它们由相同的SQL角色执行时,两个PL/Tcl函数才会共享相同的全局变量。
529529
在一个应用程序中,一个会话通过<literal>SECURITY DEFINER</literal>函数、使用<command>SET ROLE</command>等方式执行多个SQL角色的代码时,
530530
您可能需要采取明确步骤来确保PL/Tcl函数可以共享数据。
@@ -723,7 +723,7 @@ spi_exec -array C "SELECT * FROM pg_class" {
723723
</para>
724724
________________________________________________________-->
725725
<para>
726-
如果查询结果的某一列为空,那么对应的目标变量将被设置为<quote>未设置</quote>,而不是被设置。
726+
如果查询结果的某一列为空,那么对应的目标变量将被设置为<quote>unset</quote>,而不是被设置。
727727
</para>
728728
<!-- pgdoc-cn_end sig_en=a1c40e2e559cbbc8cc6926c05ab59dd3 -->
729729
</listitem>
@@ -861,7 +861,7 @@ ________________________________________________________-->
861861
<programlisting>
862862
CREATE FUNCTION t1_count(integer, integer) RETURNS integer AS $$
863863
if {![ info exists GD(plan) ]} {
864-
# 在第一次调用时准备保存的计划
864+
# prepare the saved plan on the first call
865865
set GD(plan) [ spi_prepare \
866866
"SELECT count(*) AS cnt FROM t1 WHERE num &gt;= \$1 AND num &lt;= \$2" \
867867
[ list int4 int4 ] ]
@@ -947,8 +947,9 @@ SELECT 'doesn''t' AS ret
947947
</para>
948948
________________________________________________________-->
949949
<para>
950-
双倍所有出现的单引号和反斜杠字符在给定的字符串中。这可以用来安全地引用要插入到给定的SQL命令中的字符串
951-
给<function>spi_exec</function>或<function>spi_prepare</function>。例如,考虑一个类似的SQL命令字符串:
950+
将给定字符串中的所有单引号和反斜杠字符加倍。
951+
这可以用于安全地引用要插入到SQL命令中的字符串,这些SQL命令将传递给<function>spi_exec</function>或<function>spi_prepare</function>。
952+
例如,考虑一个类似于以下的SQL命令字符串:
952953

953954
<programlisting>
954955
"SELECT '$val' AS ret"

0 commit comments

Comments
 (0)