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

17.5. インストール後の設定作業 #

<title>Post-Installation Setup</title>

17.5.1. 共有ライブラリ #

<title>Shared Libraries</title>

On some systems with shared libraries you need to tell the system how to find the newly installed shared libraries. The systems on which this is <emphasis>not</emphasis> necessary include <systemitem class="osname">FreeBSD</systemitem>, <systemitem class="osname">Linux</systemitem>, <systemitem class="osname">NetBSD</systemitem>, <systemitem class="osname">OpenBSD</systemitem>, and <systemitem class="osname">Solaris</systemitem>. 《マッチ度[79.676674]》共有ライブラリを持つ何らかのシステムの中には、新しくインストールされた共有ライブラリを探す場所をシステムに通知する必要があるものがあります。 これが必要ではないシステムはFreeBSDHP-UXLinuxNetBSDOpenBSD、およびSolarisです。 《機械翻訳》共有ライブラリを持つシステムの中には、新しくインストールされた共有ライブラリをシステムがどのように見つけるかをシステムに伝える必要があるものがあります。 これが必要でないシステムには、FreeBSDLinuxNetBSDOpenBSD、およびSolarisがあります。

The method to set the shared library search path varies between platforms, but the most widely-used method is to set the environment variable <envar>LD_LIBRARY_PATH</envar> like so: In Bourne shells (<command>sh</command>, <command>ksh</command>, <command>bash</command>, <command>zsh</command>): 共有ライブラリの検索パスを設定する方法は、プラットフォームによって異なります。 しかし、最もよく使用される方法はLD_LIBRARY_PATHといった環境変数を以下のように設定することです。 Bourne シェル(shkshbashzsh)では、

LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH

or in <command>csh</command> or <command>tcsh</command>: cshまたはtcshでは、以下のように設定します。

setenv LD_LIBRARY_PATH /usr/local/pgsql/lib

Replace <literal>/usr/local/pgsql/lib</literal> with whatever you set <option><literal>&#45;-libdir</literal></option> to in <xref linkend="configure"/>. You should put these commands into a shell start-up file such as <filename>/etc/profile</filename> or <filename>~/.bash_profile</filename>. Some good information about the caveats associated with this method can be found at <ulink url="http://xahlee.info/UnixResource_dir/_/ldpath.html"></ulink>. /usr/local/pgsql/libステップ 1--libdirに設定したものに置き換えてください。 /etc/profile~/.bash_profileといったシェルの起動ファイルにこれらのコマンドを追加してください。 この方法に関する警告についての優れた情報がhttp://xahlee.info/UnixResource_dir/_/ldpath.htmlにあります。

On some systems it might be preferable to set the environment variable <envar>LD_RUN_PATH</envar> <emphasis>before</emphasis> building. システムによっては、構築作業のLD_RUN_PATH環境変数を設定した方が良い場合があります。

On <systemitem class="osname">Cygwin</systemitem>, put the library directory in the <envar>PATH</envar> or move the <filename>.dll</filename> files into the <filename>bin</filename> directory. Cygwinでは、ライブラリディレクトリをPATHに追加するか、.dllファイルをbinディレクトリに移動します。

If in doubt, refer to the manual pages of your system (perhaps <command>ld.so</command> or <command>rld</command>). If you later get a message like: もし確信が持てない場合は、システムのマニュアルページ(おそらくld.sorld)を参照してください。 もし後に下記のようなメッセージが出たら、このステップが必要だったということです。

psql: error in loading shared libraries
libpq.so.2.1: cannot open shared object file: No such file or directory

then this step was necessary. Simply take care of it then. この場合は処置を行ってください。

If you are on <systemitem class="osname">Linux</systemitem> and you have root access, you can run: もしLinuxを使用していて、root権限があれば、

/sbin/ldconfig /usr/local/pgsql/lib

(or equivalent directory) after installation to enable the run-time linker to find the shared libraries faster. Refer to the manual page of <command>ldconfig</command> for more information. On <systemitem class="osname">FreeBSD</systemitem>, <systemitem class="osname">NetBSD</systemitem>, and <systemitem class="osname">OpenBSD</systemitem> the command is: (または同等のディレクトリ)をインストール後に実行して、実行時リンカが共有ライブラリを素早く検索できるようにできます。 より詳細についてはldconfigのマニュアルページを参照してください。 FreeBSDNetBSDおよびOpenBSDの場合のコマンドは以下のとおりです。

/sbin/ldconfig -m /usr/local/pgsql/lib

instead. Other systems are not known to have an equivalent command. 同様なコマンドを持つ他のシステムは知られていません。

17.5.2. 環境変数 #

<title>Environment Variables</title>

If you installed into <filename>/usr/local/pgsql</filename> or some other location that is not searched for programs by default, you should add <filename>/usr/local/pgsql/bin</filename> (or whatever you set <option><literal>&#45;-bindir</literal></option> to in <xref linkend="configure"/>) into your <envar>PATH</envar>. Strictly speaking, this is not necessary, but it will make the use of <productname>PostgreSQL</productname> much more convenient. もし/usr/local/pgsqlか、もしくはデフォルトでプログラムが検索されない場所にインストールした場合、/usr/local/pgsql/bin(もしくはステップ 1--bindirに設定した場所)をPATHに追加する必要があります。 厳密に言えば、これは必要ではありません。 しかし、これによってPostgreSQLの使用がずっと便利になります。

To do this, add the following to your shell start-up file, such as <filename>~/.bash_profile</filename> (or <filename>/etc/profile</filename>, if you want it to affect all users): これを行うためには、以下を~/.bash_profile(もしくは、もし全てのユーザに反映したい場合は/etc/profile)のようなシェルの起動ファイルに追加してください。

PATH=/usr/local/pgsql/bin:$PATH
export PATH

If you are using <command>csh</command> or <command>tcsh</command>, then use this command: cshtcshを使用している場合は、以下のコマンドを使用してください。

set path = ( /usr/local/pgsql/bin $path )

To enable your system to find the <application>man</application> documentation, you need to add lines like the following to a shell start-up file unless you installed into a location that is searched by default: デフォルトで検索される場所にインストールした場合を除き、システムがmanドキュメントを検索できるようにするためには、以下の行をシェルの起動ファイルに追加する必要があります。

MANPATH=/usr/local/pgsql/share/man:$MANPATH
export MANPATH

The environment variables <envar>PGHOST</envar> and <envar>PGPORT</envar> specify to client applications the host and port of the database server, overriding the compiled-in defaults. If you are going to run client applications remotely then it is convenient if every user that plans to use the database sets <envar>PGHOST</envar>. This is not required, however; the settings can be communicated via command line options to most client programs. 環境変数PGHOSTPGPORTは、クライアントアプリケーションにデータベースサーバのホストとポートを指定し、コンパイル時に決定されたデフォルト値を無効にします。 クライアントアプリケーションをリモートで実行する場合、データベースを使用する予定の全てのユーザがPGHOSTを設定していると便利です。 しかしこれは必須ではありません。 この設定は、ほとんどのクライアントプログラムのコマンドラインオプションでも設定できます。