-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-pg-isready.html
More file actions
112 lines (112 loc) · 13.5 KB
/
app-pg-isready.html
File metadata and controls
112 lines (112 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
100
101
102
103
104
105
106
107
108
109
110
111
112
<?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>pg_isready</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="app-pg-dumpall.html" title="pg_dumpall" /><link rel="next" href="app-pgreceivewal.html" title="pg_receivewal" /><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="reference-client.html" title="PostgreSQLクライアントアプリケーション">PostgreSQLクライアントアプリケーション</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 app-pg-isready.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="app-pg-dumpall.html" title="pg_dumpall">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-client.html" title="PostgreSQLクライアントアプリケーション">上へ</a></td><td width="60%" align="center"><span class="application">pg_isready</span></td><td width="20%" align="right"> <a accesskey="n" href="app-pgreceivewal.html" title="pg_receivewal">次へ</a></td></tr></table><hr /></div><div class="refentry" id="APP-PG-ISREADY"><div class="titlepage"></div><a id="id-1.9.4.14.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">pg_isready</span></span></h2><p>pg_isready<span class="original">
<refpurpose>check the connection status of a <productname>PostgreSQL</productname> server</refpurpose>
</span> — <span class="productname">PostgreSQL</span>サーバの接続状態を検査する</p></div><div class="refsynopsisdiv"><h2>概要</h2><div class="cmdsynopsis"><p id="id-1.9.4.14.4.1"><code class="command">pg_isready</code> [<em class="replaceable"><code>connection-option</code></em>...] [<em class="replaceable"><code>option</code></em>...]</p></div></div><div class="refsect1" id="APP-PG-ISREADY-DESCRIPTION"><h2>説明</h2><span class="original">
<title>Description</title>
</span><p><span class="original">
<application>pg_isready</application> is a utility for checking the connection
status of a <productname>PostgreSQL</productname> database server. The exit
status specifies the result of the connection check.
</span><span class="application">pg_isready</span>は<span class="productname">PostgreSQL</span>データベースサーバの接続状態を検査するためのユーティリティです。
終了ステータスが接続検査の結果を示します。
</p></div><div class="refsect1" id="APP-PG-ISREADY-OPTIONS"><h2>オプション</h2><span class="original">
<title>Options</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-d <em class="replaceable"><code>dbname</code></em></code><br /></span><span class="term"><code class="option">--dbname=<em class="replaceable"><code>dbname</code></em></code></span></dt><dd><p><span class="original">
Specifies the name of the database to connect to.
</span>接続するデータベースの名前を指定します。
</p><p><span class="original">
If this parameter contains an <symbol>=</symbol> sign or starts
with a valid <acronym>URI</acronym> prefix
(<literal>postgresql://</literal>
or <literal>postgres://</literal>), it is treated as a
<parameter>conninfo</parameter> string. See <xref
linkend="libpq-connstring"> for more information.
</span>このパラメータに<code class="symbol">=</code>記号が含まれる場合、または、有効な<acronym class="acronym">URI</acronym>接頭辞(<code class="literal">postgresql://</code>または<code class="literal">postgres://</code>)から始まる場合、<em class="parameter"><code>conninfo</code></em>文字列として扱われます。
詳細については<a class="xref" href="libpq-connect.html#LIBPQ-CONNSTRING" title="33.1.1. 接続文字列">33.1.1</a>を参照してください。
</p></dd><dt><span class="term"><code class="option">-h <em class="replaceable"><code>hostname</code></em></code><br /></span><span class="term"><code class="option">--host=<em class="replaceable"><code>hostname</code></em></code></span></dt><dd><p><span class="original">
Specifies the host name of the machine on which the
server is running. If the value begins
with a slash, it is used as the directory for the Unix-domain
socket.
</span>サーバが稼働しているマシンのホスト名を指定します。
値がスラッシュから始まる場合は、Unixドメインソケット用のディレクトリとして使用されます。
</p></dd><dt><span class="term"><code class="option">-p <em class="replaceable"><code>port</code></em></code><br /></span><span class="term"><code class="option">--port=<em class="replaceable"><code>port</code></em></code></span></dt><dd><p><span class="original">
Specifies the TCP port or the local Unix-domain
socket file extension on which the server is listening for
connections. Defaults to the value of the <envar>PGPORT</envar>
environment variable or, if not set, to the port specified at
compile time, usually 5432.
</span>サーバが接続を監視しているTCPポートまたはUnixドメインソケットファイルの拡張子を指定します。
デフォルトは環境変数<code class="envar">PGPORT</code>の値、もし設定されていなければ、コンパイル時に指定したポート、通常は5432です。
</p></dd><dt><span class="term"><code class="option">-q</code><br /></span><span class="term"><code class="option">--quiet</code></span></dt><dd><p><span class="original">
Do not display status message. This is useful when scripting.
</span>状態メッセージを表示しません。
これはスクリプト処理の際に有用です。
</p></dd><dt><span class="term"><code class="option">-t <em class="replaceable"><code>seconds</code></em></code><br /></span><span class="term"><code class="option">--timeout=<em class="replaceable"><code>seconds</code></em></code></span></dt><dd><p><span class="original">
The maximum number of seconds to wait when attempting connection before
returning that the server is not responding. Setting to 0 disables. The
default is 3 seconds.
</span>サーバが応答しないことを返す前に、接続試行時に待機する最大秒数です。
ゼロに設定すると無効になります。
デフォルトは3秒です。
</p></dd><dt><span class="term"><code class="option">-U <em class="replaceable"><code>username</code></em></code><br /></span><span class="term"><code class="option">--username=<em class="replaceable"><code>username</code></em></code></span></dt><dd><p><span class="original">
Connect to the database as the user <replaceable
class="parameter">username</replaceable> instead of the default.
</span>デフォルトではなく<em class="replaceable"><code>username</code></em>ユーザとしてデータベースに接続します。
</p></dd><dt><span class="term"><code class="option">-V</code><br /></span><span class="term"><code class="option">--version</code></span></dt><dd><p><span class="original">
Print the <application>pg_isready</application> version and exit.
</span><span class="application">pg_isready</span>のバージョンを表示し終了します。
</p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p><span class="original">
Show help about <application>pg_isready</application> command line
arguments, and exit.
</span><span class="application">pg_isready</span>のコマンドライン引数に関する説明を表示し終了します。
</p></dd></dl></div></div><div class="refsect1" id="id-1.9.4.14.7"><h2>終了ステータス</h2><span class="original">
<title>Exit Status</title>
</span><p><span class="original">
<application>pg_isready</application> returns <literal>0</literal> to the shell if the server
is accepting connections normally, <literal>1</literal> if the server is rejecting
connections (for example during startup), <literal>2</literal> if there was no response to the
connection attempt, and <literal>3</literal> if no attempt was made (for example due to invalid
parameters).
</span><span class="application">pg_isready</span>は、サーバが通常通り接続を受け付けている場合は<code class="literal">0</code>を、サーバが接続を拒絶している(例えば起動時)場合は<code class="literal">1</code>を、接続試行に対する応答がない場合は<code class="literal">2</code>を、試行が行われなかった(例えば無効なパラメータが原因)場合は<code class="literal">3</code>をシェルに返します。
</p></div><div class="refsect1" id="id-1.9.4.14.8"><h2>環境</h2><span class="original">
<title>Environment</title>
</span><p><span class="original">
<command>pg_isready</command>, like most other <productname>PostgreSQL</>
utilities,
also uses the environment variables supported by <application>libpq</>
(see <xref linkend="libpq-envars">).
</span>他のほとんどの<span class="productname">PostgreSQL</span>ユーティリティと同様、<code class="command">pg_isready</code>は<span class="application">libpq</span>によってサポートされる環境変数(<a class="xref" href="libpq-envars.html" title="33.14. 環境変数">33.14</a>参照)を使用します。
</p></div><div class="refsect1" id="APP-PG-ISREADY-NOTES"><h2>注釈</h2><span class="original">
<title>Notes</title>
</span><p><span class="original">
It is not necessary to supply correct user name, password, or database
name values to obtain the server status; however, if incorrect values
are provided, the server will log a failed connection attempt.
</span>サーバの状態を取得するのに、正しいユーザ名、パスワード、データベース名の値を使う必要はありません。
しかし、正しくない値が使われた場合、サーバは接続試行に失敗したことをログに記録します。
</p></div><div class="refsect1" id="APP-PG-ISREADY-EXAMPLES"><h2>例</h2><span class="original">
<title>Examples</title>
</span><p><span class="original">
Standard Usage:
</span>標準的な使用方法を示します。
</p><pre class="screen"><code class="prompt">$</code> <strong class="userinput"><code>pg_isready</code></strong>
<code class="computeroutput">/tmp:5432 - accepting connections</code>
<code class="prompt">$</code> <strong class="userinput"><code>echo $?</code></strong>
<code class="computeroutput">0</code></pre><p>
</p><p><span class="original">
Running with connection parameters to a <productname>PostgreSQL</productname> cluster in startup:
</span>起動中の<span class="productname">PostgreSQL</span>クラスタに対して接続パラメータを付けて実行します。
</p><pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>pg_isready -h localhost -p 5433</code></strong>
<code class="computeroutput">localhost:5433 - rejecting connections</code>
<code class="prompt">$</code> <strong class="userinput"><code>echo $?</code></strong>
<code class="computeroutput">1</code></pre><p>
</p><p><span class="original">
Running with connection parameters to a non-responsive <productname>PostgreSQL</productname> cluster:
</span>応答しない<span class="productname">PostgreSQL</span>クラスタに対して接続パラメータを付けて実行します。
</p><pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>pg_isready -h someremotehost</code></strong>
<code class="computeroutput">someremotehost:5432 - no response</code>
<code class="prompt">$</code> <strong class="userinput"><code>echo $?</code></strong>
<code class="computeroutput">2</code></pre><p>
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="app-pg-dumpall.html">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-client.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="app-pgreceivewal.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="application">pg_dumpall</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> pg_receivewal</td></tr></table></div></body></html>