Skip to content

Commit 343b352

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

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

postgresql/doc/src/sgml/plpython.sgml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ ________________________________________________________-->
117117

118118
<programlisting>
119119
CREATE FUNCTION <replaceable>funcname</replaceable> (<replaceable>argument-list</replaceable>)
120-
返回 <replaceable>return-type</replaceable>
120+
RETURNS <replaceable>return-type</replaceable>
121121
AS $$
122-
# PL/Python函数体
122+
# PL/Python function body
123123
$$ LANGUAGE plpython3u;
124124
</programlisting>
125125
</para>
@@ -929,7 +929,7 @@ AS $$
929929
self.value = v
930930
return named_value(name, value)
931931

932-
# 或者简单地
932+
# or simply
933933
class nv: pass
934934
nv.name = name
935935
nv.value = value
@@ -1104,8 +1104,8 @@ CREATE TYPE greeting AS (
11041104
CREATE FUNCTION greet (how text)
11051105
RETURNS SETOF greeting
11061106
AS $$
1107-
# 返回包含列表的元组作为复合类型
1108-
# 所有其他组合也可以工作
1107+
# return tuple containing lists as composite types
1108+
# all other combinations work also
11091109
return ( [ how, "World" ], [ how, "PostgreSQL" ], [ how, "PL/Python" ] )
11101110
$$ LANGUAGE plpython3u;
11111111
</programlisting>
@@ -1257,7 +1257,7 @@ ________________________________________________________-->
12571257

12581258
<programlisting>
12591259
DO $$
1260-
# PL/Python 代码
1260+
# PL/Python code
12611261
$$ LANGUAGE plpython3u;
12621262
</programlisting>
12631263

@@ -2078,13 +2078,13 @@ try:
20782078
plan = plpy.prepare("INSERT INTO fractions (frac) VALUES ($1 / $2)", ["int", "int"])
20792079
plpy.execute(plan, [numerator, denominator])
20802080
except spiexceptions.DivisionByZero:
2081-
return "分母不能为零"
2081+
return "denominator cannot equal zero"
20822082
except spiexceptions.UniqueViolation:
2083-
return "已经有该分数"
2083+
return "already have that fraction"
20842084
except plpy.SPIError as e:
2085-
return "其他错误,SQLSTATE %s" % e.sqlstate
2085+
return "other error, SQLSTATE %s" % e.sqlstate
20862086
else:
2087-
return "插入分数"
2087+
return "fraction inserted"
20882088
$$ LANGUAGE plpython3u;
20892089
</programlisting>
20902090
请注意,由于<literal>plpy.spiexceptions</literal>模块中的所有异常都继承自<literal>SPIError</literal>,

0 commit comments

Comments
 (0)