Skip to content

Commit 5929a40

Browse files
committed
Update contrib.sgml
——row89至119,调英和翻为: <!--==========================orignal english content========================== <para> Many modules supply new user-defined functions, operators, or types. To make use of one of these modules, after you have installed the code you need to register the new SQL objects in the database system. This is done by executing a <xref linkend="sql-createextension"/> command. In a fresh database, you can simply do <programlisting> CREATE EXTENSION <replaceable>module_name</replaceable>; </programlisting> This command registers the new SQL objects in the current database only, so you need to run it in each database that you want the module's facilities to be available in. Alternatively, run it in database <literal>template1</literal> so that the extension will be copied into subsequently-created databases by default. </para> ____________________________________________________________________________--> <para> 许多模块提供新的用户自定义函数、操作符或数据类型。在已经安装了代码之后,为了使用这些模块,需要在数据库系统中注册新的 SQL 对象。 可以通过执行一个<xref linkend="sql-createextension"/>命令来完成。在一个新的数据库中,你可以简单地 <programlisting> CREATE EXTENSION <replaceable>module_name</replaceable>; </programlisting> 这个命令把新的 SQL 对象注册在当前数据库中,因此你需要在每一个你希望使用该模块功能的数据库中执行他。 另外,可以在<literal>template1</literal>数据库中运行这个命令以便该扩展能被默认地复制到后续创建的数据库中。 </para> ——row120至135,增英和翻为: <!--==========================orignal english content========================== <para> For all these modules, <command>CREATE EXTENSION</command> must be run by a database superuser, unless the module is considered <quote>trusted</quote>, in which case it can be run by any user who has <literal>CREATE</literal> privilege on the current database. Modules that are trusted are identified as such in the sections that follow. Generally, trusted modules are ones that cannot provide access to outside-the-database functionality. </para> ____________________________________________________________________________--> <para> 对于所有这些模块,<command>CREATE EXTENSION</command>必须由数据库超级用户运行,除非该模块被视为<quote>trusted</quote>, 在这种情况下,它可以由在当前数据库上具有<literal>CREATE</literal>特权的任何用户运行。 受信任的模块将在下面的章节中标识为这样的模块。通常,受信任的模块不能提供对数据库外部函数的访问。 </para> ——row149,删英和翻为: <!--==========================orignal english content========================== <para> If your database was brought forward by dump and reload from a pre-9.1 version of <productname>PostgreSQL</productname>, and you had been using the pre-9.1 version of the module in it, you should instead do <programlisting> CREATE EXTENSION <replaceable>module_name</replaceable> FROM unpackaged; </programlisting> This will update the pre-9.1 objects of the module into a proper <firstterm>extension</firstterm> object. Future updates to the module will be managed by <xref linkend="sql-alterextension"/>. For more information about extension updates, see <xref linkend="extend-extensions"/>. </para> ____________________________________________________________________________--> <para> 如果你的数据库是从一个<productname>PostgreSQL</productname> 9.1 之前版本的转储载入而来,并且你已经在其中使用了一个 9.1 之前版本的该模块,你应该使用 <programlisting> CREATE EXTENSION <replaceable>module_name</replaceable> FROM unpackaged; </programlisting> 这会把该 9.1 之前的模块对象更新到一个正确的<firstterm>扩展</firstterm>对象。未来对该模块的更新将由<xref linkend="sql-alterextension"/>管理。更多关于扩展更新的信息,请见<xref linkend="extend-extensions"/>。 </para>
1 parent 14bdce1 commit 5929a40

File tree

1 file changed

+25
-33
lines changed

1 file changed

+25
-33
lines changed

postgresql/doc/src/sgml/contrib.sgml

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ ____________________________________________________________________________-->
6868
<screen>
6969
<userinput>make check</userinput>
7070
</screen>
71-
或者在一个<productname>PostgreSQL</productname>服务器正在运行时,运行
71+
在安装之前或
7272
<screen>
7373
<userinput>make installcheck</userinput>
7474
</screen>
75+
一旦你有一个<productname>PostgreSQL</productname>服务器正在运行。
7576
</para>
7677

7778
<!--==========================orignal english content==========================
@@ -90,70 +91,61 @@ ____________________________________________________________________________-->
9091
Many modules supply new user-defined functions, operators, or types.
9192
To make use of one of these modules, after you have installed the code
9293
you need to register the new SQL objects in the database system.
93-
In <productname>PostgreSQL</productname> 9.1 and later, this is done by executing
94+
This is done by executing
9495
a <xref linkend="sql-createextension"/> command. In a fresh database,
9596
you can simply do
9697

9798
<programlisting>
9899
CREATE EXTENSION <replaceable>module_name</replaceable>;
99100
</programlisting>
100101

101-
This command must be run by a database superuser. This registers the
102-
new SQL objects in the current database only, so you need to run this
103-
command in each database that you want
102+
This command registers the new SQL objects in the current database only,
103+
so you need to run it in each database that you want
104104
the module's facilities to be available in. Alternatively, run it in
105105
database <literal>template1</literal> so that the extension will be copied into
106106
subsequently-created databases by default.
107107
</para>
108108
____________________________________________________________________________-->
109109
<para>
110-
许多模块提供新的用户自定义函数、操作符或数据类型。在已经安装了代码之后,为了使用这些模块,需要在数据库系统中注册新的 SQL 对象。在<productname>PostgreSQL</productname> 9.1 及之后的版本中,可以通过执行一个<xref linkend="sql-createextension"/>命令来完成。在一个新的数据库中,你可以简单地
110+
许多模块提供新的用户自定义函数、操作符或数据类型。在已经安装了代码之后,为了使用这些模块,需要在数据库系统中注册新的 SQL 对象。
111+
可以通过执行一个<xref linkend="sql-createextension"/>命令来完成。在一个新的数据库中,你可以简单地
111112

112113
<programlisting>
113114
CREATE EXTENSION <replaceable>module_name</replaceable>;
114115
</programlisting>
115116

116-
这个命令必须由一个数据库超级用户运行。这只会把新的 SQL 对象注册在当前数据库中,因此你需要在每一个你希望使用该模块功能的数据库中执行这个命令。另外,可以在<literal>template1</literal>数据库中运行这个命令以便该扩展能被默认地复制到后续创建的数据库中。
117+
这个命令把新的 SQL 对象注册在当前数据库中,因此你需要在每一个你希望使用该模块功能的数据库中执行他。
118+
另外,可以在<literal>template1</literal>数据库中运行这个命令以便该扩展能被默认地复制到后续创建的数据库中。
117119
</para>
118120

119121
<!--==========================orignal english content==========================
120122
<para>
121-
Many modules allow you to install their objects in a schema of your
122-
choice. To do that, add <literal>SCHEMA
123-
<replaceable>schema_name</replaceable></literal> to the <command>CREATE EXTENSION</command>
124-
command. By default, the objects will be placed in your current creation
125-
target schema, which in turn defaults to <literal>public</literal>.
123+
For all these modules, <command>CREATE EXTENSION</command> must be run
124+
by a database superuser, unless the module is
125+
considered <quote>trusted</quote>, in which case it can be run by any
126+
user who has <literal>CREATE</literal> privilege on the current
127+
database. Modules that are trusted are identified as such in the
128+
sections that follow. Generally, trusted modules are ones that cannot
129+
provide access to outside-the-database functionality.
126130
</para>
127131
____________________________________________________________________________-->
128132
<para>
129-
很多模块允许你将它们的对象安装在你选择的一个模式中。要这样做,需要将<literal>SCHEMA <replaceable>schema_name</replaceable></literal>加入到<command>CREATE EXTENSION</command>命令中。默认情况下,这些对象将被放置在你的当前创建目标模式中,通常是<literal>public</literal>。
133+
对于所有这些模块,<command>CREATE EXTENSION</command>必须由数据库超级用户运行,除非该模块被视为<quote>trusted</quote>,
134+
在这种情况下,它可以由在当前数据库上具有<literal>CREATE</literal>特权的任何用户运行。
135+
受信任的模块将在下面的章节中标识为这样的模块。通常,受信任的模块不能提供对数据库外部函数的访问。
130136
</para>
131137

132138
<!--==========================orignal english content==========================
133139
<para>
134-
If your database was brought forward by dump and reload from a pre-9.1
135-
version of <productname>PostgreSQL</productname>, and you had been using the pre-9.1
136-
version of the module in it, you should instead do
137-
138-
<programlisting>
139-
CREATE EXTENSION <replaceable>module_name</replaceable> FROM unpackaged;
140-
</programlisting>
141-
142-
This will update the pre-9.1 objects of the module into a proper
143-
<firstterm>extension</firstterm> object. Future updates to the module will be
144-
managed by <xref linkend="sql-alterextension"/>.
145-
For more information about extension updates, see
146-
<xref linkend="extend-extensions"/>.
140+
Many modules allow you to install their objects in a schema of your
141+
choice. To do that, add <literal>SCHEMA
142+
<replaceable>schema_name</replaceable></literal> to the <command>CREATE EXTENSION</command>
143+
command. By default, the objects will be placed in your current creation
144+
target schema, which in turn defaults to <literal>public</literal>.
147145
</para>
148146
____________________________________________________________________________-->
149147
<para>
150-
如果你的数据库是从一个<productname>PostgreSQL</productname> 9.1 之前版本的转储载入而来,并且你已经在其中使用了一个 9.1 之前版本的该模块,你应该使用
151-
152-
<programlisting>
153-
CREATE EXTENSION <replaceable>module_name</replaceable> FROM unpackaged;
154-
</programlisting>
155-
156-
这会把该 9.1 之前的模块对象更新到一个正确的<firstterm>扩展</firstterm>对象。未来对该模块的更新将由<xref linkend="sql-alterextension"/>管理。更多关于扩展更新的信息,请见<xref linkend="extend-extensions"/>。
148+
很多模块允许你将它们的对象安装在你选择的一个模式中。要这样做,需要将<literal>SCHEMA <replaceable>schema_name</replaceable></literal>加入到<command>CREATE EXTENSION</command>命令中。默认情况下,这些对象将被放置在你的当前创建目标模式中,通常是<literal>public</literal>。
157149
</para>
158150

159151
<!--==========================orignal english content==========================

0 commit comments

Comments
 (0)