-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminpack.html
More file actions
99 lines (99 loc) · 13.5 KB
/
adminpack.html
File metadata and controls
99 lines (99 loc) · 13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>F.1. adminpack</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="contrib.html" title="付録F 追加で提供されるモジュール" /><link rel="next" href="amcheck.html" title="F.2. amcheck" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 10.5文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="contrib.html" title="付録F 追加で提供されるモジュール">付録F 追加で提供されるモジュール</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?title=version 10.5 adminpack.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="contrib.html" title="付録F 追加で提供されるモジュール">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="付録F 追加で提供されるモジュール">上へ</a></td><td width="60%" align="center">F.1. adminpack</td><td width="20%" align="right"> <a accesskey="n" href="amcheck.html" title="F.2. amcheck">次へ</a></td></tr></table><hr /></div><div class="sect1" id="ADMINPACK"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.1. adminpack</h2></div></div></div><a id="id-1.11.7.10.2" class="indexterm"></a><p><span class="original">
<filename>adminpack</> provides a number of support functions which
<application>pgAdmin</> and other administration and management tools can
use to provide additional functionality, such as remote management
of server log files.
Use of all these functions is restricted to superusers.
</span><code class="filename">adminpack</code>は、<span class="application">pgAdmin</span>やその他の管理・運用ツールがサーバログファイルの遠隔管理を行うなどの、追加的な機能を提供できるようにするための数多くのサポート関数を提供します。
この関数の使用はすべてスーパーユーザに限定されています。
</p><p><span class="original">
The functions shown in <xref linkend="functions-adminpack-table"> provide
write access to files on the machine hosting the server. (See also the
functions in <xref linkend="functions-admin-genfile-table">, which
provide read-only access.)
Only files within the database cluster directory can be accessed, but
either a relative or absolute path is allowable.
</span><a class="xref" href="adminpack.html#FUNCTIONS-ADMINPACK-TABLE" title="表F.1 adminpack関数">表 F.1</a>に示す関数はサーバをホスティングしているマシン上のファイルに対して書き込みアクセスを提供します。
(<a class="xref" href="functions-admin.html#FUNCTIONS-ADMIN-GENFILE-TABLE" title="表9.88 汎用ファイルアクセス関数">表 9.88</a>の関数も参照してください。そちらは読み取り専用アクセスを提供します。)
データベースクラスタディレクトリ内のファイルにのみアクセス可能ですが、相対パスと絶対パスのどちらも利用できます。
</p><div class="table" id="FUNCTIONS-ADMINPACK-TABLE"><p class="title"><strong>表F.1 <code class="filename">adminpack</code>関数</strong></p><div class="table-contents"><span class="original">
<title><filename>adminpack</> Functions</title>
</span><table class="table" summary="adminpack関数" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>名前</th><th>戻り値の型</th><th>説明</th></tr></thead><tbody><tr><td><code class="function">pg_catalog.pg_file_write(filename text, data text, append boolean)</code></td><td><code class="type">bigint</code></td><td><span class="original">
Write, or append to, a text file
</span>テキストファイルに書き込む、または追記する
</td></tr><tr><td><code class="function">pg_catalog.pg_file_rename(oldname text, newname text [<span class="optional">, archivename text</span>])</code></td><td><code class="type">boolean</code></td><td><span class="original">
Rename a file
</span>ファイル名を変更する
</td></tr><tr><td><code class="function">pg_catalog.pg_file_unlink(filename text)</code></td><td><code class="type">boolean</code></td><td><span class="original">
Remove a file
</span>ファイルを削除する
</td></tr><tr><td><code class="function">pg_catalog.pg_logdir_ls()</code></td><td><code class="type">setof record</code></td><td><span class="original">
List the log files in the <varname>log_directory</> directory
</span><code class="varname">log_directory</code>ディレクトリ内のログファイルの一覧を表示する
</td></tr></tbody></table></div></div><br class="table-break" /><a id="id-1.11.7.10.6" class="indexterm"></a><p><span class="original">
<function>pg_file_write</> writes the specified <parameter>data</> into
the file named by <parameter>filename</>. If <parameter>append</> is
false, the file must not already exist. If <parameter>append</> is true,
the file can already exist, and will be appended to if so.
Returns the number of bytes written.
</span><code class="function">pg_file_write</code>は指定された<em class="parameter"><code>data</code></em>を<em class="parameter"><code>filename</code></em>で指定されたファイルに書き込みます
<em class="parameter"><code>append</code></em>が偽であれば、ファイルは既に存在していてはいけません。
<em class="parameter"><code>append</code></em>が真であれば、ファイルが既に存在していても構いません。その場合、追記されます。
書き込んだバイト数を返します。
</p><a id="id-1.11.7.10.8" class="indexterm"></a><p><span class="original">
<function>pg_file_rename</> renames a file. If <parameter>archivename</>
is omitted or NULL, it simply renames <parameter>oldname</>
to <parameter>newname</> (which must not already exist).
If <parameter>archivename</> is provided, it first
renames <parameter>newname</> to <parameter>archivename</> (which must
not already exist), and then renames <parameter>oldname</>
to <parameter>newname</>. In event of failure of the second rename step,
it will try to rename <parameter>archivename</> back
to <parameter>newname</> before reporting the error.
Returns true on success, false if the source file(s) are not present or
not writable; other cases throw errors.
</span><code class="function">pg_file_rename</code>はファイルの名前を変更します。
<em class="parameter"><code>archivename</code></em>が省略されたり、NULLである場合は、単純に<em class="parameter"><code>oldname</code></em>を<em class="parameter"><code>newname</code></em>(既に存在していてはいけません)に変更します。
<em class="parameter"><code>archivename</code></em>が指定されていれば、まず<em class="parameter"><code>newname</code></em>を<em class="parameter"><code>archivename</code></em>(既に存在していてはいけません)に変更し、それから<em class="parameter"><code>oldname</code></em>を<em class="parameter"><code>newname</code></em>に変更します。
第2段階の名前の変更が失敗した場合には、エラーを報告する前に<em class="parameter"><code>archivename</code></em>を<em class="parameter"><code>newname</code></em>に戻そうとします。
成功した場合には真を、元のファイルが存在しなかったり、書き込みできなかった場合には偽を返します。その他の場合にはエラーを発生します。
</p><a id="id-1.11.7.10.10" class="indexterm"></a><p><span class="original">
<function>pg_file_unlink</> removes the specified file.
Returns true on success, false if the specified file is not present
or the <function>unlink()</> call fails; other cases throw errors.
</span><code class="function">pg_file_unlink</code>は指定されたファイルを削除します。
成功した場合には真を、指定されたファイルが存在しなかったり、<code class="function">unlink()</code>の呼出しが失敗した場合には偽を返します。その他の場合にはエラーを発生します。
</p><a id="id-1.11.7.10.12" class="indexterm"></a><p><span class="original">
<function>pg_logdir_ls</> returns the start timestamps and path
names of all the log files in the <xref linkend="guc-log-directory">
directory. The <xref linkend="guc-log-filename"> parameter must have its
default setting (<literal>postgresql-%Y-%m-%d_%H%M%S.log</>) to use this
function.
</span><code class="function">pg_logdir_ls</code>は<a class="xref" href="runtime-config-logging.html#GUC-LOG-DIRECTORY">log_directory</a>ディレクトリ内にあるログファイルすべての開始時のタイムスタンプとパス名を返します。
この関数を使うには、<a class="xref" href="runtime-config-logging.html#GUC-LOG-FILENAME">log_filename</a>パラメータはデフォルト設定(<code class="literal">postgresql-%Y-%m-%d_%H%M%S.log</code>)でなければなりません。
</p><p><span class="original">
The functions shown
in <xref linkend="functions-adminpack-deprecated-table"> are deprecated
and should not be used in new applications; instead use those shown
in <xref linkend="functions-admin-signal-table">
and <xref linkend="functions-admin-genfile-table">. These functions are
provided in <filename>adminpack</> only for compatibility with old
versions of <application>pgAdmin</>.
</span><a class="xref" href="adminpack.html#FUNCTIONS-ADMINPACK-DEPRECATED-TABLE" title="表F.2 廃止予定のadminpack関数">表 F.2</a>に示す関数は廃止予定であり、新しいアプリケーションでは使うべきではありません。代わりに<a class="xref" href="functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE" title="表9.78 サーバシグナル送信関数">表 9.78</a>や<a class="xref" href="functions-admin.html#FUNCTIONS-ADMIN-GENFILE-TABLE" title="表9.88 汎用ファイルアクセス関数">表 9.88</a>に示す関数を使ってください。
この関数は<span class="application">pgAdmin</span>の古いバージョンとの互換性のためだけに<code class="filename">adminpack</code>で提供されています。
</p><div class="table" id="FUNCTIONS-ADMINPACK-DEPRECATED-TABLE"><p class="title"><strong>表F.2 廃止予定の<code class="filename">adminpack</code>関数</strong></p><div class="table-contents"><span class="original">
<title>Deprecated <filename>adminpack</> Functions</title>
</span><table class="table" summary="廃止予定のadminpack関数" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>名前</th><th>戻り値の型</th><th>説明</th></tr></thead><tbody><tr><td><code class="function">pg_catalog.pg_file_read(filename text, offset bigint, nbytes bigint)</code></td><td><code class="type">text</code></td><td><span class="original">
Alternate name for <function>pg_read_file()</>
</span><code class="function">pg_read_file()</code>の別名
</td></tr><tr><td><code class="function">pg_catalog.pg_file_length(filename text)</code></td><td><code class="type">bigint</code></td><td><span class="original">
Same as <structfield>size</> column returned
by <function>pg_stat_file()</>
</span><code class="function">pg_stat_file()</code>が返す<code class="structfield">size</code>列と同じ
</td></tr><tr><td><code class="function">pg_catalog.pg_logfile_rotate()</code></td><td><code class="type">integer</code></td><td><span class="original">
Alternate name for <function>pg_rotate_logfile()</>, but note that it
returns integer 0 or 1 rather than <type>boolean</type>
</span><code class="function">pg_rotate_logfile()</code>の別名。<code class="type">boolean</code>ではなく、integerで0または1を返すことに注意
</td></tr></tbody></table></div></div><br class="table-break" /></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="contrib.html">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="amcheck.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">付録F 追加で提供されるモジュール </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> F.2. amcheck</td></tr></table></div></body></html>