Skip to content

Commit 4e219f2

Browse files
committed
Update ref/prefpare.sgml
ref/prefpare.sgml 调整内容(2019.12.15): row6: 根据WinMerge比较结果,将 "<refentry id="SQL-PREPARE">" 调整为小写 "<refentry id="sql-prepare">" row93 根据WinMerge比较结果,将 "in which the parameter is used (if possible)." 调整为新内容 "in which the parameter is first referenced (if possible)." row101 根据row93英文内容变化,将 "其类型会从该参数被使用的环境中推知(如果可能)" 调整为新翻译内容 "其类型会从该参数第一次被引用的环境中推知(如果可能)" row174 根据WinMerge比较结果,将 "from the context in which the parameter is used." 调整为新内容 "from the context in which the parameter is first referenced." row180 根据row174英文内容变化,将 "将从该参数被使用的环境中推得" 调整为新翻译内容 "将从该参数第一次被引用的环境中推得" row206 根据WinMerge比较结果,将 "<refsect1 id="SQL-PREPARE-notes">" 调整为小写 "<refsect1 id="sql-prepare-notes">" 其他更新 将英文原文中的</>补充相应tag 注1. 潜在疑问, "<literal>$<replaceable>n</></literal>" 是否应替换为 " <literal>$<replaceable>n</replaceable></literal>"
1 parent 2c7a297 commit 4e219f2

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

postgresql/doc/src/sgml/ref/prepare.sgml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ doc/src/sgml/ref/prepare.sgml
33
PostgreSQL documentation
44
-->
55

6-
<refentry id="SQL-PREPARE">
6+
<refentry id="sql-prepare">
77
<!--==========================orignal english content==========================
88
<indexterm zone="sql-prepare">
99
<primary>PREPARE</primary>
@@ -86,19 +86,19 @@ ____________________________________________________________________________-->
8686
Prepared statements can take parameters: values that are
8787
substituted into the statement when it is executed. When creating
8888
the prepared statement, refer to parameters by position, using
89-
<literal>$1</>, <literal>$2</>, etc. A corresponding list of
89+
<literal>$1</literal>, <literal>$2</literal>, etc. A corresponding list of
9090
parameter data types can optionally be specified. When a
9191
parameter's data type is not specified or is declared as
9292
<literal>unknown</literal>, the type is inferred from the context
93-
in which the parameter is used (if possible). When executing the
93+
in which the parameter is first referenced (if possible). When executing the
9494
statement, specify the actual values for these parameters in the
9595
<command>EXECUTE</command> statement. Refer to <xref
9696
linkend="sql-execute"> for more
9797
information about that.
9898
</para>
9999
____________________________________________________________________________-->
100100
<para>
101-
预备语句可以接受参数:在执行时会被替换到语句中的值。在创建预备语句时,可以用位置引用参数,如<literal>$1</literal>、<literal>$2</literal>等。也可以选择性地指定参数数据类型的一个列表。当一个参数的数据类型没有被指定或者被声明为<literal>unknown</literal>时,其类型会从该参数被使用的环境中推知(如果可能)。在执行该语句时,在<command>EXECUTE</command>语句中为这些参数指定实际值。更多有关于此的信息可参考<xref linkend="sql-execute"/>。
101+
预备语句可以接受参数:在执行时会被替换到语句中的值。在创建预备语句时,可以用位置引用参数,如<literal>$1</literal>、<literal>$2</literal>等。也可以选择性地指定参数数据类型的一个列表。当一个参数的数据类型没有被指定或者被声明为<literal>unknown</literal>时,其类型会从该参数第一次被引用的环境中推知(如果可能)。在执行该语句时,在<command>EXECUTE</command>语句中为这些参数指定实际值。更多有关于此的信息可参考<xref linkend="sql-execute"/>。
102102
</para>
103103

104104
<!--==========================orignal english content==========================
@@ -171,13 +171,13 @@ ____________________________________________________________________________-->
171171
The data type of a parameter to the prepared statement. If the
172172
data type of a particular parameter is unspecified or is
173173
specified as <literal>unknown</literal>, it will be inferred
174-
from the context in which the parameter is used. To refer to the
174+
from the context in which the parameter is first referenced. To refer to the
175175
parameters in the prepared statement itself, use
176176
<literal>$1</literal>, <literal>$2</literal>, etc.
177177
</para>
178178
____________________________________________________________________________-->
179179
<para>
180-
预备语句一个参数的数据类型。如果一个特定参数的数据类型没有被指定或者被指定为<literal>unknown</literal>,将从该参数被使用的环境中推得。要在预备语句本身中引用参数,可以使用
180+
预备语句一个参数的数据类型。如果一个特定参数的数据类型没有被指定或者被指定为<literal>unknown</literal>,将从该参数第一次被引用的环境中推得。要在预备语句本身中引用参数,可以使用
181181
<literal>$1</literal>、<literal>$2</literal>等。
182182
</para>
183183
</listitem>
@@ -191,8 +191,8 @@ ____________________________________________________________________________-->
191191
<listitem>
192192
<!--==========================orignal english content==========================
193193
<para>
194-
Any <command>SELECT</>, <command>INSERT</>, <command>UPDATE</>,
195-
<command>DELETE</>, or <command>VALUES</> statement.
194+
Any <command>SELECT</command>, <command>INSERT</command>, <command>UPDATE</command>,
195+
<command>DELETE</command>, or <command>VALUES</command> statement.
196196
</para>
197197
____________________________________________________________________________-->
198198
<para>
@@ -203,7 +203,7 @@ ____________________________________________________________________________-->
203203
</variablelist>
204204
</refsect1>
205205

206-
<refsect1 id="SQL-PREPARE-notes">
206+
<refsect1 id="sql-prepare-notes">
207207
<!--==========================orignal english content==========================
208208
<title>Notes</title>
209209
____________________________________________________________________________-->
@@ -249,9 +249,9 @@ ____________________________________________________________________________-->
249249
<para>
250250
To examine the query plan <productname>PostgreSQL</productname> is using
251251
for a prepared statement, use <xref linkend="sql-explain">, e.g.
252-
<command>EXPLAIN EXECUTE</>.
252+
<command>EXPLAIN EXECUTE</command>.
253253
If a generic plan is in use, it will contain parameter symbols
254-
<literal>$<replaceable>n</></literal>, while a custom plan will have the
254+
<literal>$<replaceable>n</replaceable></literal>, while a custom plan will have the
255255
supplied parameter values substituted into it.
256256
The row estimates in the generic plan reflect the selectivity
257257
computed for the parameters.
@@ -276,21 +276,21 @@ ____________________________________________________________________________-->
276276
<!--==========================orignal english content==========================
277277
<para>
278278
Although the main point of a prepared statement is to avoid repeated parse
279-
analysis and planning of the statement, <productname>PostgreSQL</> will
279+
analysis and planning of the statement, <productname>PostgreSQL</productname> will
280280
force re-analysis and re-planning of the statement before using it
281281
whenever database objects used in the statement have undergone
282282
definitional (DDL) changes since the previous use of the prepared
283283
statement. Also, if the value of <xref linkend="guc-search-path"> changes
284284
from one use to the next, the statement will be re-parsed using the new
285-
<varname>search_path</>. (This latter behavior is new as of
285+
<varname>search_path</varname>. (This latter behavior is new as of
286286
<productname>PostgreSQL</productname> 9.3.) These rules make use of a
287287
prepared statement semantically almost equivalent to re-submitting the
288288
same query text over and over, but with a performance benefit if no object
289289
definitions are changed, especially if the best plan remains the same
290290
across uses. An example of a case where the semantic equivalence is not
291291
perfect is that if the statement refers to a table by an unqualified name,
292292
and then a new table of the same name is created in a schema appearing
293-
earlier in the <varname>search_path</>, no automatic re-parse will occur
293+
earlier in the <varname>search_path</varname>, no automatic re-parse will occur
294294
since no object used in the statement changed. However, if some other
295295
change forces a re-parse, the new table will be referenced in subsequent
296296
uses.
@@ -349,7 +349,7 @@ EXECUTE usrrptplan(1, current_date);
349349
</programlisting>
350350

351351
Note that the data type of the second parameter is not specified,
352-
so it is inferred from the context in which <literal>$2</> is used.
352+
so it is inferred from the context in which <literal>$2</literal> is used.
353353
</para>
354354
____________________________________________________________________________-->
355355
<para>

0 commit comments

Comments
 (0)