バージョンごとのドキュメント一覧

20.2. ファイルの場所 #

<title>File Locations</title>

In addition to the <filename>postgresql.conf</filename> file already mentioned, <productname>PostgreSQL</productname> uses two other manually-edited configuration files, which control client authentication (their use is discussed in <xref linkend="client-authentication"/>). By default, all three configuration files are stored in the database cluster's data directory. The parameters described in this section allow the configuration files to be placed elsewhere. (Doing so can ease administration. In particular it is often easier to ensure that the configuration files are properly backed-up when they are kept separate.) すでに説明したpostgresql.confファイルに加え、PostgreSQLは、クライアント認証の管理を行うために、他の2つの手作業で編集される設定ファイルを使用します(これらの使用方法は第21章で説明します)。 全ての3つの設定ファイルは、デフォルトではデータベースクラスタのdataディレクトリに格納されます。 本節で説明するパラメータにより、設定ファイルを他の場所に置くことが可能になります。 (そのようにすると管理がしやすくなります。 とりわけ、設定ファイルを分けて保存することで、設定ファイルの適切なバックアップを確実に行うことがしばしば容易になります。)

data_directory (string) #

Specifies the directory to use for data storage. This parameter can only be set at server start. データ格納に使用するディレクトリを指定します。 このパラメータはサーバ起動時のみ設定可能です

config_file (string) #

Specifies the main server configuration file (customarily called <filename>postgresql.conf</filename>). This parameter can only be set on the <command>postgres</command> command line. メインサーバ設定ファイルを指定します(通例postgresql.confと呼ばれます)。 このパラメータはpostgresコマンドライン上でのみ設定可能です。

hba_file (string) #

Specifies the configuration file for host-based authentication (customarily called <filename>pg_hba.conf</filename>). This parameter can only be set at server start. ホストベース認証(HBA)用のファイルを指定します(通例pg_hba.confと呼ばれます)。 このパラメータはサーバ起動時のみ設定可能です。

ident_file (string) #

Specifies the configuration file for user name mapping (customarily called <filename>pg_ident.conf</filename>). This parameter can only be set at server start. See also <xref linkend="auth-username-maps"/>. ユーザ名マッピングの設定ファイルを指定します(通例pg_ident.confと呼ばれます)。 このパラメータはサーバ起動時のみ設定可能です。 21.2もご覧ください。

external_pid_file (string) #

Specifies the name of an additional process-ID (PID) file that the server should create for use by server administration programs. This parameter can only be set at server start. サーバ管理プログラムで使用するためにサーバが作成する、追加のプロセス識別子(PID)ファイルの名前を指定します。 このパラメータはサーバ起動時のみ設定可能です。

In a default installation, none of the above parameters are set explicitly. Instead, the data directory is specified by the <option>-D</option> command-line option or the <envar>PGDATA</envar> environment variable, and the configuration files are all found within the data directory. デフォルトのインストールでは、上記のいかなるパラメータも明示的に設定されません。 その代わり、data ディレクトリは-Dコマンドラインオプション、またはPGDATA環境変数で指定され、設定ファイル全てはその data ディレクトリ内に格納されます。

If you wish to keep the configuration files elsewhere than the data directory, the <command>postgres</command> <option>-D</option> command-line option or <envar>PGDATA</envar> environment variable must point to the directory containing the configuration files, and the <varname>data_directory</varname> parameter must be set in <filename>postgresql.conf</filename> (or on the command line) to show where the data directory is actually located. Notice that <varname>data_directory</varname> overrides <option>-D</option> and <envar>PGDATA</envar> for the location of the data directory, but not for the location of the configuration files. dataディレクトリ以外の場所に設定ファイルを格納したいのであれば、postgres-Dコマンドラインオプション、またはPGDATA環境変数で設定ファイルの場所を指し示し、そしてdataディレクトリが実際どこに存在するのかを示すため、postgresql.confの(もしくはコマンドライン上で)data_directoryパラメータを設定しなければなりません。 data_directoryは、設定ファイルの場所ではなく、data ディレクトリの位置に関して、-DおよびPGDATAを上書きすることに注意してください。

If you wish, you can specify the configuration file names and locations individually using the parameters <varname>config_file</varname>, <varname>hba_file</varname> and/or <varname>ident_file</varname>. <varname>config_file</varname> can only be specified on the <command>postgres</command> command line, but the others can be set within the main configuration file. If all three parameters plus <varname>data_directory</varname> are explicitly set, then it is not necessary to specify <option>-D</option> or <envar>PGDATA</envar>. 必要に応じて、パラメータconfig_filehba_fileident_fileを使用し、設定ファイルの名前と場所を個別に指定することができます。 config_filepostgresコマンドラインによってのみ指定されますが、その他は主設定ファイル内で設定できます。 全ての3つのパラメータとdata_directoryが明示的に設定されていれば、-DまたはPGDATAを指定する必要はありません。

When setting any of these parameters, a relative path will be interpreted with respect to the directory in which <command>postgres</command> is started. これらのパラメータのどれを設定する場合でも、相対パスは、postgresが起動されるディレクトリから見た相対パスとして解釈されます。