Skip to content

Commit f59b900

Browse files
author
messon
committed
translate finished
1 parent 2001c74 commit f59b900

File tree

4 files changed

+50
-24
lines changed

4 files changed

+50
-24
lines changed

postgresql/doc/src/sgml/sources.sgml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ ____________________________________________________________________________-->
187187
message text. In addition there are optional elements, the most
188188
common of which is an error identifier code that follows the SQL spec's
189189
SQLSTATE conventions.
190-
<function>ereport</function> itself is just a shell macro, that exists
190+
<function>ereport</function> itself is just a shell macro that exists
191191
mainly for the syntactic convenience of making message generation
192192
look like a single function call in the C source code. The only parameter
193193
accepted directly by <function>ereport</function> is the severity level.
@@ -414,6 +414,14 @@ ____________________________________________________________________________-->
414414
<function>errmsg</function>.
415415
</para>
416416
</listitem>
417+
<listitem>
418+
<para>
419+
<function>errhint_plural(const char *fmt_singular, const char *fmt_plural,
420+
unsigned long n, ...)</function> is like <function>errhint</function>, but with
421+
support for various plural forms of the message.
422+
For more information see <xref linkend="nls-guidelines"/>.
423+
</para>
424+
</listitem>
417425
<listitem>
418426
<para>
419427
<function>errcontext(const char *msg, ...)</function> is not normally called
@@ -574,6 +582,12 @@ ____________________________________________________________________________-->
574582
<function>errhint(const char *msg, ...)</function>提供一个可选的<quote>hint</quote>消息,它被用来提供关于如何修复该问题的建议。该消息字符串以和<function>errmsg</function>相同的方式处理。
575583
</para>
576584
</listitem>
585+
<listitem>
586+
<para>
587+
<function>errhint_plural(const char *fmt_singular, const char *fmt_plural,
588+
unsigned long n, ...)</function>与<function>errhint</function>相似,但是支持多种复数形式的消息。详见<xref linkend="nls-guidelines"/>。
589+
</para>
590+
</listitem>
577591
<listitem>
578592
<para>
579593
<function>errcontext(const char *msg, ...)</function>通常不会被直接从一个<function>ereport</function>消息站点调用,它被用在<literal>error_context_stack</literal>回调函数中来提供错误发生的上下文,例如一个 PL 函数中的当前位置。该消息字符串以和<function>errmsg</function>相同的方式处理。不同于其他辅助函数,在每次<function>ereport</function>调用中可以多次调用这个函数,这样提供的连续的字符串将被用单独的新行串接在一起。
@@ -1409,6 +1423,24 @@ ____________________________________________________________________________-->
14091423
</para>
14101424
</formalpara>
14111425

1426+
<formalpara>
1427+
<!--==========================orignal english content==========================
1428+
<title>Non-negative</title>
1429+
____________________________________________________________________________-->
1430+
<title>Non-negative</title>
1431+
<!--==========================orignal english content==========================
1432+
<para>
1433+
Avoid <quote>non-negative</quote> as it is ambiguous
1434+
about whether it accepts zero. It's better to use
1435+
<quote>greater than zero</quote> or
1436+
<quote>greater than or equal to zero</quote>.
1437+
</para>
1438+
____________________________________________________________________________-->
1439+
<para>
1440+
避免<quote>non-negative</quote>,因为它不能清楚表达是否接受0。最好使用<quote>greater than zero</quote>或<quote>greater than or equal to zero</quote>。
1441+
</para>
1442+
</formalpara>
1443+
14121444
</simplesect>
14131445

14141446
<simplesect>

postgresql/doc/src/sgml/syntax.sgml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,15 +1429,15 @@ ____________________________________________________________________________-->
14291429
<para>
14301430
When working with non-SQL-standard operator names, you will usually
14311431
need to separate adjacent operators with spaces to avoid ambiguity.
1432-
For example, if you have defined a left unary operator named <literal>@</literal>,
1432+
For example, if you have defined a prefix operator named <literal>@</literal>,
14331433
you cannot write <literal>X*@Y</literal>; you must write
14341434
<literal>X* @Y</literal> to ensure that
14351435
<productname>PostgreSQL</productname> reads it as two operator names
14361436
not one.
14371437
</para>
14381438
____________________________________________________________________________-->
14391439
<para>
1440-
当使用非 SQL 标准的操作符名时,你通常需要用空格分隔相邻的操作符来避免歧义。例如,如果你定义了一个名为<literal>@</literal>的左一元操作符,你不能写<literal>X*@Y</literal>,你必须写<literal>X* @Y</literal>来确保<productname>PostgreSQL</productname>把它读作两个操作符名而不是一个。
1440+
当使用非 SQL 标准的操作符名时,你通常需要用空格分隔相邻的操作符来避免歧义。例如,如果你定义了一个名为<literal>@</literal>的前缀操作符,你不能写<literal>X*@Y</literal>,你必须写<literal>X* @Y</literal>来确保<productname>PostgreSQL</productname>把它读作两个操作符名而不是一个。
14411441
</para>
14421442
</sect2>
14431443

@@ -1950,11 +1950,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
19501950
cases, these changes will result in no behavioral change, or perhaps
19511951
in <quote>no such operator</quote> failures which can be resolved by adding
19521952
parentheses. However there are corner cases in which a query might
1953-
change behavior without any parsing error being reported. If you are
1954-
concerned about whether these changes have silently broken something,
1955-
you can test your application with the configuration
1956-
parameter <xref linkend="guc-operator-precedence-warning"/> turned on
1957-
to see if any warnings are logged.
1953+
change behavior without any parsing error being reported.
19581954
</para>
19591955
____________________________________________________________________________-->
19601956
<para>
@@ -1967,9 +1963,7 @@ ____________________________________________________________________________-->
19671963
逻辑上等价的结构不一致的处理,这些规则也得到了修改。在大部分情况下,
19681964
这些变化不会导致行为上的变化,或者可能会产生<quote>no such operator</quote>
19691965
错误,但可以通过增加圆括号解决。不过在一些极端情况中,查询可能在
1970-
没有被报告解析错误的情况下发生行为的改变。如果你发觉这些改变悄悄地
1971-
破坏了一些事情,可以打开<xref linkend="guc-operator-precedence-warning"/>
1972-
配置参数,然后测试你的应用看看有没有一些警告被记录。
1966+
没有被报告解析错误的情况下发生行为的改变。
19731967
</para>
19741968
</note>
19751969
</sect2>
@@ -2566,7 +2560,7 @@ ____________________________________________________________________________-->
25662560

25672561
<!--==========================orignal english content==========================
25682562
<para>
2569-
There are three possible syntaxes for an operator invocation:
2563+
There are two possible syntaxes for an operator invocation:
25702564
<simplelist>
25712565
<member><replaceable>expression</replaceable> <replaceable>operator</replaceable> <replaceable>expression</replaceable> (binary infix operator)</member>
25722566
<member><replaceable>operator</replaceable> <replaceable>expression</replaceable> (unary prefix operator)</member>
@@ -2586,11 +2580,10 @@ ____________________________________________________________________________-->
25862580
</para>
25872581
____________________________________________________________________________-->
25882582
<para>
2589-
对于一次操作符调用,有三种可能的语法
2583+
对于一次操作符调用,有两种可能的语法
25902584
<simplelist>
25912585
<member><replaceable>expression</replaceable> <replaceable>operator</replaceable> <replaceable>expression</replaceable>(二元中缀操作符)</member>
25922586
<member><replaceable>operator</replaceable> <replaceable>expression</replaceable>(一元前缀操作符)</member>
2593-
<member><replaceable>expression</replaceable> <replaceable>operator</replaceable>(一元后缀操作符)</member>
25942587
</simplelist>
25952588
其中<replaceable>operator</replaceable>记号遵循<xref linkend="sql-syntax-operators"/>的语法规则,或者是关键词<token>AND</token>、<token>OR</token>和<token>NOT</token>之一,或者是一个如下形式的受限定操作符名:
25962589
<synopsis>

postgresql/doc/src/sgml/typeconv.sgml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ has an associated data type which determines its behavior and allowed usage.
6868
<productname>PostgreSQL</productname> has an extensible type system that is
6969
more general and flexible than other <acronym>SQL</acronym> implementations.
7070
Hence, most type conversion behavior in <productname>PostgreSQL</productname>
71-
is governed by general rules rather than by <foreignphrase>ad hoc</foreignphrase>
71+
is governed by general rules rather than by ad hoc
7272
heuristics. This allows the use of mixed-type expressions even with
7373
user-defined types.
7474
</para>
7575
____________________________________________________________________________-->
7676
<para>
77-
<acronym>SQL</acronym>是一种强类型语言。也就是说,每个数据项都有一个相关的数据类型,数据类型决定其行为和允许的用法。 <productname>PostgreSQL</productname>有一个可扩展的类型系统,该系统比其它<acronym>SQL</acronym>实现更具通用和灵活。因而,<productname>PostgreSQL</productname>中大多数类型转换行为是由通用规则来管理的,而不是<foreignphrase>ad hoc</foreignphrase>启发式规则。这种做法允许使用混合类型表达式,即便是其中包含用户定义的类型。
77+
<acronym>SQL</acronym>是一种强类型语言。也就是说,每个数据项都有一个相关的数据类型,数据类型决定其行为和允许的用法。 <productname>PostgreSQL</productname>有一个可扩展的类型系统,该系统比其它<acronym>SQL</acronym>实现更具通用和灵活。因而,<productname>PostgreSQL</productname>中大多数类型转换行为是由通用规则来管理的,而不是特定的启发式规则。这种做法允许使用混合类型表达式,即便是其中包含用户定义的类型。
7878
</para>
7979

8080
<!--==========================orignal english content==========================
@@ -146,8 +146,8 @@ Operators
146146
<listitem>
147147
<para>
148148
<productname>PostgreSQL</productname> allows expressions with
149-
prefix and postfix unary (one-argument) operators,
150-
as well as binary (two-argument) operators. Like functions, operators can
149+
prefix (one-argument) operators,
150+
as well as infix (two-argument) operators. Like functions, operators can
151151
be overloaded, so the same problem of selecting the right operator
152152
exists.
153153
</para>
@@ -206,7 +206,7 @@ ____________________________________________________________________________-->
206206
</term>
207207
<listitem>
208208
<para>
209-
<productname>PostgreSQL</productname>允许带有前缀和后缀一元(单目)操作符的表达式,也允许二元(两个参数)操作符。像函数一样,操作符也可以被重载,因此操作符的选择也有同样的问题。
209+
<productname>PostgreSQL</productname>允许带有前缀(单目)操作符的表达式,也允许中缀(两个参数)操作符。像函数一样,操作符也可以被重载,因此操作符的选择也有同样的问题。
210210
</para>
211211
</listitem>
212212
</varlistentry>
@@ -445,12 +445,12 @@ ____________________________________________________________________________-->
445445
<para>
446446
If one argument of a binary operator invocation is of the <type>unknown</type> type,
447447
then assume it is the same type as the other argument for this check.
448-
Invocations involving two <type>unknown</type> inputs, or a unary operator
448+
Invocations involving two <type>unknown</type> inputs, or a prefix operator
449449
with an <type>unknown</type> input, will never find a match at this step.
450450
</para>
451451
____________________________________________________________________________-->
452452
<para>
453-
如果一个二元操作符调用中的一个参数是<type>unknown</type>类型,则在本次检查中假设它与另一个参数类型相同。 对于涉及两个<type>unknown</type>输入的调用或者带有一个<type>unknown</type>输入的一元操作符,在这一步将永远找不到一个匹配。
453+
如果一个二元操作符调用中的一个参数是<type>unknown</type>类型,则在本次检查中假设它与另一个参数类型相同。 对于涉及两个<type>unknown</type>输入的调用或者带有一个<type>unknown</type>输入的前缀操作符,在这一步将永远找不到一个匹配。
454454
</para>
455455
</step>
456456
<step id="op-resol-exact-domain" performance="optional">

postgresql/doc/src/sgml/uuid-ossp.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ ____________________________________________________________________________-->
4949
<para>
5050
<xref linkend="uuid-ossp-functions"/> shows the functions available to
5151
generate UUIDs.
52-
The relevant standards ITU-T Rec. X.667, ISO/IEC 9834-8:2005, and RFC
53-
4122 specify four algorithms for generating UUIDs, identified by the
52+
The relevant standards ITU-T Rec. X.667, ISO/IEC 9834-8:2005, and
53+
<ulink url="https://tools.ietf.org/html/rfc4122">RFC 4122</ulink>
54+
specify four algorithms for generating UUIDs, identified by the
5455
version numbers 1, 3, 4, and 5. (There is no version 2 algorithm.)
5556
Each of these algorithms could be suitable for a different set of
5657
applications.
5758
</para>
5859
____________________________________________________________________________-->
5960
<para>
60-
<xref linkend="uuid-ossp-functions"/>展示了可用来产生 UUID 的函数。相关标准 ITU-T Rec. X.667、ISO/IEC 9834-8:2005 以及 RFC 4122 指定了四种用于产生 UUID 的算法,分别用版本号 1、3、4、5 标识(没有版本 2 的算法)。这些算法中的每一个都适合于不同的应用集合。
61+
<xref linkend="uuid-ossp-functions"/>展示了可用来产生 UUID 的函数。相关标准 ITU-T Rec. X.667、ISO/IEC 9834-8:2005 以及<ulink url="https://tools.ietf.org/html/rfc4122">RFC 4122</ulink>指定了四种用于产生 UUID 的算法,分别用版本号 1、3、4、5 标识(没有版本 2 的算法)。这些算法中的每一个都适合于不同的应用集合。
6162
</para>
6263

6364
<table id="uuid-ossp-functions">

0 commit comments

Comments
 (0)