-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-pg-isready.html
More file actions
154 lines (154 loc) · 14.1 KB
/
app-pg-isready.html
File metadata and controls
154 lines (154 loc) · 14.1 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?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@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><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 id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</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?template=bug_report.yml&what-happened=version 18.3 : 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.16.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.16.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. The
<replaceable>dbname</replaceable> can be a <link
linkend="libpq-connstring">connection string</link>. If so,
connection string parameters will override any conflicting command
line options.
</span>
接続するデータベースの名前を指定します。
<em class="replaceable"><code>dbname</code></em>は<a class="link" href="libpq-connect.html#LIBPQ-CONNSTRING" title="32.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.16.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.16.8"><h2>環境</h2><span class="original">
<title>Environment</title>
</span><p>
<span class="original">
<command>pg_isready</command>, like most other <productname>PostgreSQL</productname>
utilities,
also uses the environment variables supported by <application>libpq</application>
(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="32.15. 環境変数">32.15</a>参照)を使用します。
</p><p>
<span class="original">
The environment variable <envar>PG_COLOR</envar> specifies whether to use
color in diagnostic messages. Possible values are
<literal>always</literal>, <literal>auto</literal> and
<literal>never</literal>.
</span>
環境変数<code class="envar">PG_COLOR</code>は診断メッセージで色を使うかどうかを指定します。
指定可能な値は<code class="literal">always</code>、<code class="literal">auto</code>、<code class="literal">never</code>です。
</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" title="pg_dumpall">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-client.html" title="PostgreSQLクライアントアプリケーション">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="app-pgreceivewal.html" title="pg_receivewal">次へ</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" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> <span class="application">pg_receivewal</span></td></tr></table></div></body></html>