@@ -17,38 +17,40 @@ ____________________________________________________________________________-->
17
17
18
18
<!--==========================orignal english content==========================
19
19
<para>
20
- <filename>adminpack</> provides a number of support functions which
21
- <application>pgAdmin</> and other administration and management tools can
20
+ <filename>adminpack</filename > provides a number of support functions which
21
+ <application>pgAdmin</application > and other administration and management tools can
22
22
use to provide additional functionality, such as remote management
23
23
of server log files.
24
- Use of all these functions is restricted to superusers.
24
+ Use of all these functions is only allowed to the superuser by default but may be
25
+ allowed to other users by using the <command>GRANT</command> command.
25
26
</para>
26
27
____________________________________________________________________________-->
27
28
<para>
28
- <filename>adminpack</filename>提供了一些支持函数,<application>pgAdmin</application>和其他管理工具会用这些函数来提供额外的功能,例如服务器日志文件的远程管理。只有超级用户才能使用全部这些函数 。
29
+ <filename>adminpack</filename> 提供了一些支持函数,<application>pgAdmin</application> 和其他管理工具会用这些函数来提供额外的功能,例如服务器日志文件的远程管理。所有这些函数默认只允许由超级用户使用,但是可以通过使用 <command>GRANT</command> 命令允许其他用户使用 。
29
30
</para>
30
31
31
32
<!--==========================orignal english content==========================
32
33
<para>
33
- The functions shown in <xref linkend="functions-adminpack-table"> provide
34
+ The functions shown in <xref linkend="functions-adminpack-table"/ > provide
34
35
write access to files on the machine hosting the server. (See also the
35
- functions in <xref linkend="functions-admin-genfile-table">, which
36
+ functions in <xref linkend="functions-admin-genfile-table"/ >, which
36
37
provide read-only access.)
37
- Only files within the database cluster directory can be accessed, but
38
- either a relative or absolute path is allowable.
38
+ Only files within the database cluster directory can be accessed, unless the
39
+ user is a superuser or given one of the pg_read_server_files, or pg_write_server_files
40
+ roles, as appropriate for the function, but either a relative or absolute path is
41
+ allowable.
39
42
</para>
40
43
____________________________________________________________________________-->
41
44
<para>
42
45
<xref linkend="functions-adminpack-table"/>中展示的函数提供了向运行
43
46
着服务器的机器上的文件进行写入的途径(另见
44
47
<xref linkend="functions-admin-genfile-table"/>中的函数,它们提供了
45
- 只读的访问途径)。只有位于数据库集簇目录中的文件才能被访问,不过相对
46
- 路径和绝对路径都可以使用。
48
+ 只读的访问途径)。对于这些函数,只有位于数据库集簇目录中的文件才能被访问(除非用户是一个超级用户或者被指定了 pg_read_server_files 或者 pg_write_server_files 角色之一),不过允许使用相对路径和绝对路径。
47
49
</para>
48
50
49
51
<table id="functions-adminpack-table">
50
52
<!--==========================orignal english content==========================
51
- <title><filename>adminpack</> Functions</title>
53
+ <title><filename>adminpack</filename > Functions</title>
52
54
____________________________________________________________________________-->
53
55
<title><filename>adminpack</filename> 函数</title>
54
56
<tgroup cols="3">
@@ -115,15 +117,15 @@ ____________________________________________________________________________-->
115
117
<entry><function>pg_catalog.pg_logdir_ls()</function></entry>
116
118
<entry><type>setof record</type></entry>
117
119
<entry>
118
- List the log files in the <varname>log_directory</> directory
120
+ List the log files in the <varname>log_directory</varname > directory
119
121
</entry>
120
122
</row>
121
123
____________________________________________________________________________-->
122
124
<row>
123
125
<entry><function>pg_catalog.pg_logdir_ls()</function></entry>
124
126
<entry><type>setof record</type></entry>
125
127
<entry>
126
- 列出在<varname>log_directory</varname>目录中的日志文件
128
+ 列出在 <varname>log_directory</varname> 目录中的日志文件
127
129
</entry>
128
130
</row>
129
131
</tbody>
@@ -140,17 +142,15 @@ ____________________________________________________________________________-->
140
142
</indexterm>
141
143
<!--==========================orignal english content==========================
142
144
<para>
143
- <function>pg_file_write</> writes the specified <parameter>data</> into
144
- the file named by <parameter>filename</>. If <parameter>append</> is
145
- false, the file must not already exist. If <parameter>append</> is true,
145
+ <function>pg_file_write</function > writes the specified <parameter>data</parameter > into
146
+ the file named by <parameter>filename</parameter >. If <parameter>append</parameter > is
147
+ false, the file must not already exist. If <parameter>append</parameter > is true,
146
148
the file can already exist, and will be appended to if so.
147
149
Returns the number of bytes written.
148
150
</para>
149
151
____________________________________________________________________________-->
150
152
<para>
151
- <function>pg_file_write</function>把指定的<parameter>data</parameter>写入到由
152
- <parameter>filename</parameter>命名的文件中。如果<parameter>append</parameter>
153
- 为假,文件不能已经存在。如果<parameter>append</parameter>为真,该文件
153
+ <function>pg_file_write</function> 把指定的 <parameter>data</parameter> 写入到由 <parameter>filename</parameter> 命名的文件中。如果 <parameter>append</parameter> 为假,文件不能已经存在。如果 <parameter>append</parameter> 为真,该文件
154
154
可能已经存在,并且如果存在就会被追加。这个函数返回写入的字节数。
155
155
</para>
156
156
@@ -164,15 +164,15 @@ ____________________________________________________________________________-->
164
164
</indexterm>
165
165
<!--==========================orignal english content==========================
166
166
<para>
167
- <function>pg_file_rename</> renames a file. If <parameter>archivename</>
168
- is omitted or NULL, it simply renames <parameter>oldname</>
169
- to <parameter>newname</> (which must not already exist).
170
- If <parameter>archivename</> is provided, it first
171
- renames <parameter>newname</> to <parameter>archivename</> (which must
172
- not already exist), and then renames <parameter>oldname</>
173
- to <parameter>newname</>. In event of failure of the second rename step,
174
- it will try to rename <parameter>archivename</> back
175
- to <parameter>newname</> before reporting the error.
167
+ <function>pg_file_rename</function > renames a file. If <parameter>archivename</parameter >
168
+ is omitted or NULL, it simply renames <parameter>oldname</parameter >
169
+ to <parameter>newname</parameter > (which must not already exist).
170
+ If <parameter>archivename</parameter > is provided, it first
171
+ renames <parameter>newname</parameter > to <parameter>archivename</parameter > (which must
172
+ not already exist), and then renames <parameter>oldname</parameter >
173
+ to <parameter>newname</parameter >. In event of failure of the second rename step,
174
+ it will try to rename <parameter>archivename</parameter > back
175
+ to <parameter>newname</parameter > before reporting the error.
176
176
Returns true on success, false if the source file(s) are not present or
177
177
not writable; other cases throw errors.
178
178
</para>
@@ -200,9 +200,9 @@ ____________________________________________________________________________-->
200
200
</indexterm>
201
201
<!--==========================orignal english content==========================
202
202
<para>
203
- <function>pg_file_unlink</> removes the specified file.
203
+ <function>pg_file_unlink</function > removes the specified file.
204
204
Returns true on success, false if the specified file is not present
205
- or the <function>unlink()</> call fails; other cases throw errors.
205
+ or the <function>unlink()</function > call fails; other cases throw errors.
206
206
</para>
207
207
____________________________________________________________________________-->
208
208
<para>
@@ -221,10 +221,10 @@ ____________________________________________________________________________-->
221
221
</indexterm>
222
222
<!--==========================orignal english content==========================
223
223
<para>
224
- <function>pg_logdir_ls</> returns the start timestamps and path
225
- names of all the log files in the <xref linkend="guc-log-directory">
226
- directory. The <xref linkend="guc-log-filename"> parameter must have its
227
- default setting (<literal>postgresql-%Y-%m-%d_%H%M%S.log</>) to use this
224
+ <function>pg_logdir_ls</function > returns the start timestamps and path
225
+ names of all the log files in the <xref linkend="guc-log-directory"/ >
226
+ directory. The <xref linkend="guc-log-filename"/ > parameter must have its
227
+ default setting (<literal>postgresql-%Y-%m-%d_%H%M%S.log</literal >) to use this
228
228
function.
229
229
</para>
230
230
____________________________________________________________________________-->
@@ -235,98 +235,4 @@ ____________________________________________________________________________-->
235
235
<literal>postgresql-%Y-%m-%d_%H%M%S.log</literal>)。
236
236
</para>
237
237
238
- <!--==========================orignal english content==========================
239
- <para>
240
- The functions shown
241
- in <xref linkend="functions-adminpack-deprecated-table"> are deprecated
242
- and should not be used in new applications; instead use those shown
243
- in <xref linkend="functions-admin-signal-table">
244
- and <xref linkend="functions-admin-genfile-table">. These functions are
245
- provided in <filename>adminpack</> only for compatibility with old
246
- versions of <application>pgAdmin</>.
247
- </para>
248
- ____________________________________________________________________________-->
249
- <para>
250
- The functions shown
251
- in
252
- <xref linkend="functions-adminpack-deprecated-table"/>中展示的函数
253
- 已经被废弃,新的应用不应该使用它们,而是使用
254
- <xref linkend="functions-admin-signal-table"/>和
255
- <xref linkend="functions-admin-genfile-table"/>中所示的那些函数。在
256
- <filename>adminpack</filename>中提供这些函数只是为了兼容旧版本的
257
- <application>pgAdmin</application>。
258
- </para>
259
-
260
- <table id="functions-adminpack-deprecated-table">
261
- <!--==========================orignal english content==========================
262
- <title>Deprecated <filename>adminpack</> Functions</title>
263
- ____________________________________________________________________________-->
264
- <title>废弃的 <filename>adminpack</filename> 函数</title>
265
- <tgroup cols="3">
266
- <thead>
267
- <!--==========================orignal english content==========================
268
- <row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry>
269
- </row>
270
- ____________________________________________________________________________-->
271
- <row><entry>名称</entry> <entry>返回类型</entry> <entry>描述</entry>
272
- </row>
273
- </thead>
274
-
275
- <tbody>
276
- <!--==========================orignal english content==========================
277
- <row>
278
- <entry><function>pg_catalog.pg_file_read(filename text, offset bigint, nbytes bigint)</function></entry>
279
- <entry><type>text</type></entry>
280
- <entry>
281
- Alternate name for <function>pg_read_file()</>
282
- </entry>
283
- </row>
284
- ____________________________________________________________________________-->
285
- <row>
286
- <entry><function>pg_catalog.pg_file_read(filename text, offset bigint, nbytes bigint)</function></entry>
287
- <entry><type>text</type></entry>
288
- <entry>
289
- <function>pg_read_file()</function>的另一个名字
290
- </entry>
291
- </row>
292
- <!--==========================orignal english content==========================
293
- <row>
294
- <entry><function>pg_catalog.pg_file_length(filename text)</function></entry>
295
- <entry><type>bigint</type></entry>
296
- <entry>
297
- Same as <structfield>size</> column returned
298
- by <function>pg_stat_file()</>
299
- </entry>
300
- </row>
301
- ____________________________________________________________________________-->
302
- <row>
303
- <entry><function>pg_catalog.pg_file_length(filename text)</function></entry>
304
- <entry><type>bigint</type></entry>
305
- <entry>
306
- 和<function>pg_stat_file()</function>返回的<structfield>size</structfield>列一样
307
- </entry>
308
- </row>
309
- <!--==========================orignal english content==========================
310
- <row>
311
- <entry><function>pg_catalog.pg_logfile_rotate()</function></entry>
312
- <entry><type>integer</type></entry>
313
- <entry>
314
- Alternate name for <function>pg_rotate_logfile()</>, but note that it
315
- returns integer 0 or 1 rather than <type>boolean</type>
316
- </entry>
317
- </row>
318
- ____________________________________________________________________________-->
319
- <row>
320
- <entry><function>pg_catalog.pg_logfile_rotate()</function></entry>
321
- <entry><type>integer</type></entry>
322
- <entry>
323
- Alternate name for
324
- <function>pg_rotate_logfile()</function>的另一个名字,但是要注意它返回
325
- 整数 0 或者 1 而不是<type>boolean</type>
326
- </entry>
327
- </row>
328
- </tbody>
329
- </tgroup>
330
- </table>
331
-
332
238
</sect1>
0 commit comments