postgres

Name

postgres  --  Run a Postgres single-user backend Postgres シングルユーザバックエンドの起動

Synopsis

postgres [ dbname ]
postgres [ -B nBuffers ] [ -C ] [ -D DataDir ] [ -E ] [ -F ]
   [ -O ] [ -Q ] [ -S SortSize ] [ -d [ DebugLevel ] ] [ -e ]
   [ -o ] [ OutputFile ] [ -s ] [ -v protocol ] [ dbname ]
  

入力

postgres accepts the following command line arguments:

postgres では以下のコマンドライン引数を 認めています。

dbname

The optional argument dbname specifies the name of the database to be accessed. dbname defaults to the value of the USER environment variable.

オプションの引数である dbname は、アクセスするデータベース名を指定します。 デフォルトの dbnameUSER 環境変数の値です。

-B nBuffers

If the backend is running under the postmaster, nBuffers is the number of shared-memory buffers that the postmaster has allocated for the backend server processes that it starts. If the backend is running standalone, this specifies the number of buffers to allocate. This value defaults to 64 buffers, where each buffer is 8k bytes (or whatever BLCKSZ is set to in config.h).

バックエンドが postmaster のもとで起動していれば、 nBuffers は、立ち上がった時点にバックエンドサーバプロセスに postmaster が割り当てた共有メモリバッファの数です。 バックエンドが単独で起動していれば、これは割り当てられるバッファ の数を指定します。 デフォルトの値は 64 バッファで、一つのバッファの大きさは 8K バイト (または config.h で設定された BLCKSZ の値)です。

-C

Do not show the server version number.

サーバのバージョンを表示しません。

-D DataDir

Specifies the directory to use as the root of the tree of database directories. If -D is not given, the default data directory name is the value of the environment variable PGDATA. If PGDATA is not set, then the directory used is $POSTGRESHOME/data. If neither environment variable is set and this command-line option is not specified, the default directory that was set at compile-time is used.

データベースディレクトリのツリーのルートとして使用するディレクトリ を指定します。-D が与えられていない場合、デフォルトのデータ ディレクトリの名前は、環境変数 PGDATA の値になります。 PGDATA が設定されていなければ、使用されるディレクトリは $POSTGRESHOME/data となります。 環境変数が設定されていないで、コマンドラインオプションも特定されて いない場合は、コンパイルした時に設定されたデフォルトのディレクトリ が使用されます。

-E

Echo all queries.

全ての問合せをエコーします。

-F

Disable an automatic fsync() call after each transaction. This option improves performance, but an operating system crash while a transaction is in progress may cause the loss of the most recently entered data. Without the fsync() call the data is buffered by the operating system, and written to disk sometime later.

それぞれのトランザクション完了毎に、自動的に fsync() 呼び出しを行わないようにします。このオプションはパフォーマンスを向上させ ますが、トランザクション実行中のオペレーティングシステムがクラッシュした 場合には、直近に入力されたデータが失われる可能性があります。 fsync() 呼び出しがないと、データはオペレーティング システムのバッファに記憶され、後のある時間内にディスクに書き込まれます。

-O

Override restrictions, so system table structures can be modified. These tables are typically those with a leading "pg_" in the table name.

制限事項を書き換えます。したがって、システムテーブルの構成は修正 可能となります。 これらのテーブルはテーブル名の中で、典型的に、 "pg_" から始まる名前 になっています。

-Q

Specifies "quiet" mode.

"沈黙"モードを指定します。

-S SortSize

Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. The value is specified in kilobytes, and defaults to 512 kilobytes. Note that for a complex query, several sorts and/or hashes might be running in parallel, and each one will be allowed to use as much as SortSize kilobytes before it starts to put data into temporary files.

暫定的なディスクファイルに再ソートする以前に、内部ソートとハッシュに よって使われるメモリの大きさを指定します。 値はキロバイト単位で指定されて、デフォルトは 512K バイトになって います。 複雑な問合せではいくつかのソート もハッシュも並行して実行されている場合があって、それぞれの ソート、ハッシュは暫定ファイルにデータを書き出す直前まで SortSize キロバイト ぎりぎりまで使える様になっています。

-d [ DebugLevel ]

The optional argument DebugLevel determines the amount of debugging output the backend servers will produce. If DebugLevel is one, the postmaster will trace all connection traffic, and nothing else. For levels two and higher, debugging is turned on in the backend process and the postmaster displays more information, including the backend environment and process traffic. Note that if no file is specified for backend servers to send their debugging output then this output will appear on the controlling tty of their parent postmaster.

オプション引数の DebugLevel はバックエンドサーバが生成するデバッグ出力の大きさを決定します。 DebugLevel が 1 の時、 postmaster は全ての接続トラフィックをトレースしてそれでお仕舞いです。 レベルが 2 以上の場合、バックエンドプロセスでデバッグ機能が有効になり postmaster はバックエンドの環境とトラフィック処理を含む、より多くの 情報を表示します。 バックエンドサーバがデバッグ結果を送るべきファイルが指定されて いない場合、この結果はそれぞれの親である postmaster の tty 制御に出現します。

-e

This option controls how dates are interpreted upon input to and output from the database. If the -e option is supplied, then dates passed to and from the frontend processes will be assumed to be in "European" format (DD-MM-YYYY), otherwise dates are assumed to be in "American" format (MM-DD-YYYY). Dates are accepted by the backend in a wide variety of formats, and for input dates this switch mostly affects the interpretation for ambiguous cases. See データ型 for more information.

このオプションは日付が、データベースへの入力とデータベースからの出力 に際してどのように翻訳されるか制御します。 -e が付いた場合、フロントエンドプロセスと交換 される日付は "European" 形式の (DD-MM-YYYY) であると仮定され、そうでない場合 "American" 形式 (MM-DD-YYYY) となります。 日付データはバックエンドによって各種の形式で受け付けられます。 そして、入力された日付に対して、この変換機構はどちらとであっても 良いと判断して構わない場合に、特に影響を及ぼします。 より詳しくは データ型 を参照して 下さい。

-o OutputFile

Sends all debugging and error output to OutputFile. If the backend is running under the postmaster, error messages are still sent to the frontend process as well as to OutputFile, but debugging output is sent to the controlling tty of the postmaster (since only one file descriptor can be sent to an actual file).

全てのデバッグとエラーの出力を OutputFile ファイルに記録します。 バックエンドが postmaster のもとで 起動していればエラーメッセージはフロントエンドプロセスにも、 OutputFile にも出力されますが、デバッグの出力は postmaster tty 制御に送られます。(というのは、一つのファイル記述子しか 実ファイルに送ることが出来ないからです。)

-s

Print time information and other statistics at the end of each query. This is useful for benchmarking or for use in tuning the number of buffers.

時刻情報とその他の統計情報を各問合せの終りに表示します。ベンチマークを 行う時やバッファの数を調整するときに便利です。

-v protocol

Specifies the number of the frontend/backend protocol to be used for this particular session.

この特定のセッションで使用されるフロントエンド/バックエンドプロトコル 番号を指定します。

There are several other options that may be specified, used mainly for debugging purposes. These are listed here only for the use by Postgres system developers. Use of any of these options is highly discouraged. Furthermore, any of these options may disappear or change at any time.

主にデバッグ目的で使用されるいくつかのその他のオプションが指定できます。 これらオプションを Postgres システム 開発者用にリストしました。 これらのオプションの使用で障害を引き起こすことがあります。 さらに、これらのオプションが、ある日突然なくなったり変更されたり することがあります。

These special-case options are:

特別のケースのオプションです:

-A n|r|b|Q\fIn\fP|X\fIn\fP

This option generates a tremendous amount of output.

このオプションは驚くべき多くの量の出力を生成します。

-L

Turns off the locking system.

ロックシステムを中止します。

-N

Disables use of newline as a query delimiter.

問合せのデリミタとしての改行の使用を無効にします。

-f [ s | i | m | n | h ]

Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, while n, m, and h disable nested-loop, merge and hash joins respectively.

特定のスキャンとジョインメソッドの使用を禁止します: si はそれぞれ逐次スキャンとインデックススキャンを無効にし、一方 nm および h は、それぞれ入れ子のループ、マージそしてハッシュのジョインを 無効にします。

Note: Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative.

逐次スキャンまたは入れ子のループジョインを完全に無効にすることは 出来ません。-fs および -fn オプションは単にオプティマイザがほかの選択肢を持っている場合 これらのプランの型を使用しないというだけです。

-i

Prevents query execution, but shows the plan tree.

問合せを実行しません。但しプランのツリー構造を表示します。

-p dbname

Indicates to the backend server that it has been started by a postmaster and make different assumptions about buffer pool management, file descriptors, etc. Switches following -p are restricted to those considered "secure".

postmaster によって起動されたことを バックエンドサーバに通知して、バッファプール管理、 ファイル記述子その他について、異なった仮定します。 -p に続くスイッチは "secure" と見なされるものに制限されます。

-t pa[rser] | pl[anner] | e[xecutor]

Print timing statistics for each query relating to each of the major system modules. This option cannot be used with -s.

それぞれの主だったシステムモジュールに関連するひとつひとつの 問合せに対するタイミングの統計を出力します。このオプションは -s と同時に使うことが出来ません。

出力

Of the nigh-infinite number of error messages you may see when you execute the backend server directly, the most common will probably be:

バックエンドサーバを直接実行したとき、出食わす身近でであってなお 不特定なエラーメッセージの中で最も一般的なものは下記のようなもので しょう:

semget: No space left on device

If you see this message, you should run the ipcclean command. After doing this, try starting postmaster again. If this still doesn't work, you probably need to configure your kernel for shared memory and semaphores as described in the installation notes. If you have a kernel with particularly small shared memory and/or semaphore limits, you may have to reconfigure your kernel to increase its shared memory or semaphore parameters.

このメッセージが出たときは、 ipcclean コマンドを実行しなければなりません。実行後、 postmaster を再起動します。引続きエラーが出るようであれば、 インストールの注意書きにしたがって、共有メモリとセマフォに ついてカーネルを構築する必要がありそうです。 特別に小さい共有メモリであったりセマフォの限界が小さかったり、 この二つともの場合のカーネルであるとすると、共有メモリと セマフォのパラメータを拡張するようにカーネルを再構築しなければ なりません。

Tip: You may be able to postpone reconfiguring your kernel by decreasing -B to reduce Postgres' shared memory consumption.

Postgres の共有メモリ消費量 を低くするため -B を使用し、カーネルの再構築を先に延ばす 事も出来ます。

Description

The Postgres backend server can be executed directly from the user shell. This should be done only while debugging by the DBA, and should not be done while other Postgres backends are being managed by a postmaster on this set of databases.

Postgres バックエンドサーバはユーザシェルから直接実行することが出来ます。 この操作は DBA によるデバッグ場合のみに限定され、このデータベースセット 上の postmaster によって別の Postgres バックエンドが管理されている場合は、操作を行って はなりません。

Some of the switches explained here can be passed to the backend through the "database options" field of a connection request, and thus can be set for a particular backend without going to the trouble of restarting the postmaster. This is particularly handy for debugging-related switches.

ここで説明したいくつかのスイッチは接続要求の"データベースオプション" フィールドを通じてバックエンドに渡され、したがい面倒な postmaster の 再起動を行はなくても特定のバックエンドに対し設定が出来ます。 このことはデバッグに関連したスイッチではとくに重宝です。

The optional argument dbname specifies the name of the database to be accessed. dbname defaults to the value of the USER environment variable.

オプション引数の dbname でアクセスするデータベース名を指定します。 デフォルトの dbnameUSER の環境変数の値となります。

注意事項

Useful utilities for dealing with shared memory problems include ipcs(1), ipcrm(1), and ipcclean(1). See also postmaster.

共有メモリ問題を扱う有用なユーティリティには、 ipcs(1)ipcrm(1) そして ipcclean(1)があります。 postmaster も参照して下さい。