The following environment variables can be used to select default
connection parameter values, which will be used by
<xref linkend="libpq-PQconnectdb"/>, <xref linkend="libpq-PQsetdbLogin"/> and
<xref linkend="libpq-PQsetdb"/> if no value is directly specified by the calling
code. These are useful to avoid hard-coding database connection
information into simple client applications, for example.
以下の環境変数を使用して、呼び出し側のプログラムで直接値を指定しなかった場合の接続パラメータのデフォルト値を選ぶことができます。
この値は、PQconnectdb、PQsetdbLoginおよびPQsetdbで使用されます。
例えば、簡単なクライアントアプリケーションでは、データベース接続情報を直接プログラムに記述しない方が便利です。
<envar>PGHOST</envar> behaves the same as the <xref
linkend="libpq-connect-host"/> connection parameter.
PGHOSTはhost接続パラメータと同様に動作します。
<envar>PGSSLNEGOTIATION</envar> behaves the same as the <xref
linkend="libpq-connect-sslnegotiation"/> connection parameter.
PGSSLNEGOTIATIONはsslnegotiation接続パラメータと同様に動作します。
<envar>PGHOSTADDR</envar> behaves the same as the <xref
linkend="libpq-connect-hostaddr"/> connection parameter.
This can be set instead of or in addition to <envar>PGHOST</envar>
to avoid DNS lookup overhead.
PGHOSTADDRはhostaddr接続パラメータと同様に動作します。
PGHOSTの代わりに設定して、または、PGHOSTに追加して、DNS検索に要するオーバーヘッドをなくすことができます。
<envar>PGPORT</envar> behaves the same as the <xref
linkend="libpq-connect-port"/> connection parameter.
PGPORTはport接続パラメータと同様に動作します。
<envar>PGDATABASE</envar> behaves the same as the <xref
linkend="libpq-connect-dbname"/> connection parameter.
PGDATABASEはdbname接続パラメータと同様に動作します。
<envar>PGUSER</envar> behaves the same as the <xref
linkend="libpq-connect-user"/> connection parameter.
PGUSERはuser接続パラメータと同様に動作します。
<envar>PGPASSWORD</envar> behaves the same as the <xref
linkend="libpq-connect-password"/> connection parameter.
Use of this environment variable
is not recommended for security reasons, as some operating systems
allow non-root users to see process environment variables via
<application>ps</application>; instead consider using a password file
(see <xref linkend="libpq-pgpass"/>).
PGPASSWORDはpassword接続パラメータと同様に動作します。
この環境変数は、一部のオペレーティングシステムではroot以外のユーザがpsコマンド経由で環境変数を見ることができるなど、セキュリティ上の理由から現在では推奨されていません。
代わりにパスワードファイル(32.16を参照してください)を使用することを検討してください。
<envar>PGPASSFILE</envar> behaves the same as the <xref
linkend="libpq-connect-passfile"/> connection parameter.
PGPASSFILEはpassfile接続パラメータと同様に動作します。
<envar>PGREQUIREAUTH</envar> behaves the same as the <xref
linkend="libpq-connect-require-auth"/> connection parameter.
PGREQUIREAUTHはrequire_auth接続パラメータと同様に動作します。
<envar>PGCHANNELBINDING</envar> behaves the same as the <xref
linkend="libpq-connect-channel-binding"/> connection parameter.
PGCHANNELBINDINGはchannel_binding接続パラメータと同様に動作します。
<envar>PGSERVICE</envar> behaves the same as the <xref
linkend="libpq-connect-service"/> connection parameter.
PGSERVICEはservice接続パラメータと同様に動作します。
<envar>PGSERVICEFILE</envar> specifies the name of the per-user
connection service file
(see <xref linkend="libpq-pgservice"/>).
Defaults to <filename>~/.pg_service.conf</filename>, or
<filename>%APPDATA%\postgresql\.pg_service.conf</filename> on
Microsoft Windows.
PGSERVICEFILEは、ユーザ毎の接続サービスファイルを指定します(32.17参照)。
デフォルトは~/.pg_service.conf、Microsoft Windowsでは%APPDATA%\postgresql\.pg_service.confです。
<envar>PGOPTIONS</envar> behaves the same as the <xref
linkend="libpq-connect-options"/> connection parameter.
PGOPTIONSはoptions接続パラメータと同様に動作します。
<envar>PGAPPNAME</envar> behaves the same as the <xref
linkend="libpq-connect-application-name"/> connection parameter.
PGAPPNAMEはapplication_name接続パラメータと同様に動作します。
<envar>PGSSLMODE</envar> behaves the same as the <xref
linkend="libpq-connect-sslmode"/> connection parameter.
PGSSLMODEはsslmode接続パラメータと同様に動作します。
<envar>PGREQUIRESSL</envar> behaves the same as the <xref
linkend="libpq-connect-requiressl"/> connection parameter.
This environment variable is deprecated in favor of the
<envar>PGSSLMODE</envar> variable; setting both variables suppresses the
effect of this one.
PGREQUIRESSLはrequiressl接続パラメータと同様に動作します。
この環境変数はPGSSLMODE変数があるため、廃止予定となっています。
両方の変数を設定すると、PGREQUIRESSLの設定は無視されます。
<envar>PGSSLCOMPRESSION</envar> behaves the same as the <xref
linkend="libpq-connect-sslcompression"/> connection parameter.
PGSSLCOMPRESSIONはsslcompression接続パラメータと同様に動作します。
<envar>PGSSLCERT</envar> behaves the same as the <xref
linkend="libpq-connect-sslcert"/> connection parameter.
PGSSLCERTはsslcert接続パラメータと同様に動作します。
<envar>PGSSLKEY</envar> behaves the same as the <xref
linkend="libpq-connect-sslkey"/> connection parameter.
PGSSLKEYはsslkey接続パラメータと同様に動作します。
<envar>PGSSLCERTMODE</envar> behaves the same as the <xref
linkend="libpq-connect-sslcertmode"/> connection parameter.
PGSSLCERTMODEはsslcertmode接続パラメータと同様に動作します。
<envar>PGSSLROOTCERT</envar> behaves the same as the <xref
linkend="libpq-connect-sslrootcert"/> connection parameter.
PGSSLROOTCERTはsslrootcert接続パラメータと同様に動作します。
<envar>PGSSLCRL</envar> behaves the same as the <xref
linkend="libpq-connect-sslcrl"/> connection parameter.
PGSSLCRLはsslcrl接続パラメータと同様に動作します。
<envar>PGSSLCRLDIR</envar> behaves the same as the <xref
linkend="libpq-connect-sslcrldir"/> connection parameter.
PGSSLCRLDIRは、sslcrldir接続パラメータと同様に動作します。
<envar>PGSSLSNI</envar> behaves the same as the <xref
linkend="libpq-connect-sslsni"/> connection parameter.
PGSSLSNIはsslsni接続パラメータと同様に動作します。
<envar>PGREQUIREPEER</envar> behaves the same as the <xref
linkend="libpq-connect-requirepeer"/> connection parameter.
PGREQUIREPEERはrequirepeer接続パラメータと同様に動作します。
<envar>PGSSLMINPROTOCOLVERSION</envar> behaves the same as the <xref
linkend="libpq-connect-ssl-min-protocol-version"/> connection parameter.
PGSSLMINPROTOCOLVERSIONはssl_min_protocol_version接続パラメータと同様に動作します。
<envar>PGSSLMAXPROTOCOLVERSION</envar> behaves the same as the <xref
linkend="libpq-connect-ssl-max-protocol-version"/> connection parameter.
PGSSLMAXPROTOCOLVERSIONはssl_max_protocol_version接続パラメータと同様に動作します。
<envar>PGGSSENCMODE</envar> behaves the same as the <xref
linkend="libpq-connect-gssencmode"/> connection parameter.
PGGSSENCMODEはgssencmode接続パラメータと同様に動作します。
<envar>PGKRBSRVNAME</envar> behaves the same as the <xref
linkend="libpq-connect-krbsrvname"/> connection parameter.
PGKRBSRVNAMEはkrbsrvname接続パラメータと同様に動作します。
<envar>PGGSSLIB</envar> behaves the same as the <xref
linkend="libpq-connect-gsslib"/> connection parameter.
PGGSSLIBはgsslib接続パラメータと同様に動作します。
<envar>PGGSSDELEGATION</envar> behaves the same as the <xref
linkend="libpq-connect-gssdelegation"/> connection parameter.
PGGSSDELEGATIONはgssdelegation接続パラメータと同様に動作します。
<envar>PGCONNECT_TIMEOUT</envar> behaves the same as the <xref
linkend="libpq-connect-connect-timeout"/> connection parameter.
PGCONNECT_TIMEOUTはconnect_timeout接続パラメータと同様に動作します。
<envar>PGCLIENTENCODING</envar> behaves the same as the <xref
linkend="libpq-connect-client-encoding"/> connection parameter.
PGCLIENTENCODINGはclient_encoding接続パラメータと同様に動作します。
<envar>PGTARGETSESSIONATTRS</envar> behaves the same as the <xref
linkend="libpq-connect-target-session-attrs"/> connection parameter.
PGTARGETSESSIONATTRSはtarget_session_attrs接続パラメータと同様に動作します。
<envar>PGLOADBALANCEHOSTS</envar> behaves the same as the <xref
linkend="libpq-connect-load-balance-hosts"/> connection parameter.
PGLOADBALANCEHOSTSはload_balance_hosts接続パラメータと同様に動作します。
<envar>PGMINPROTOCOLVERSION</envar> behaves the same as the <xref
linkend="libpq-connect-min-protocol-version"/> connection parameter.
《マッチ度[85.820896]》PGSSLMINPROTOCOLVERSIONはssl_min_protocol_version接続パラメータと同様に動作します。
《機械翻訳》PGMINPROTOCOLVERSIONはmin_protocol_versionコネクションパラメータと同じ動作をします。
<envar>PGMAXPROTOCOLVERSION</envar> behaves the same as the <xref
linkend="libpq-connect-max-protocol-version"/> connection parameter.
《マッチ度[85.820896]》PGSSLMAXPROTOCOLVERSIONはssl_max_protocol_version接続パラメータと同様に動作します。
《機械翻訳》PGMAXPROTOCOLVERSIONはmax_protocol_versionのコネクションパラメータと同じ動作をします。
The following environment variables can be used to specify default behavior for each <productname>PostgreSQL</productname> session. (See also the <xref linkend="sql-alterrole"/> and <xref linkend="sql-alterdatabase"/> commands for ways to set default behavior on a per-user or per-database basis.) 以下の環境変数を使用して、PostgreSQLセッション毎のデフォルト動作を指定することができます。 (また、ユーザ毎、もしくは、データベース毎を単位としたデフォルト動作の設定方法についてはALTER ROLEおよびALTER DATABASEコマンドを参照してください。)
<envar>PGDATESTYLE</envar> sets the default style of date/time
representation. (Equivalent to <literal>SET datestyle TO
...</literal>.)
PGDATESTYLEはデフォルトの日付/時刻表現形式を設定します。
(SET datestyle TO ...と等価です。)
<envar>PGTZ</envar> sets the default time zone. (Equivalent to
<literal>SET timezone TO ...</literal>.)
PGTZはデフォルトの時間帯を設定します。
(SET timezone TO ...と等価です。)
<envar>PGGEQO</envar> sets the default mode for the genetic query
optimizer. (Equivalent to <literal>SET geqo TO ...</literal>.)
PGGEQOは遺伝的問い合わせオプティマイザのデフォルトのモードを設定します。
(SET geqo TO ...と等価です。)
Refer to the <acronym>SQL</acronym> command <xref linkend="sql-set"/> for information on correct values for these environment variables. これらの環境変数の正確な値については、SET SQLコマンドを参照してください。
The following environment variables determine internal behavior of <application>libpq</application>; they override compiled-in defaults. 以下の環境変数は、libpqの内部動作を決定します。 これらはコンパイル時のデフォルトを上書きします。
<envar>PGSYSCONFDIR</envar> sets the directory containing the
<filename>pg_service.conf</filename> file and in a future version
possibly other system-wide configuration files.
PGSYSCONFDIRはpg_service.confファイルがあるディレクトリを設定します。
また今後のバージョンでは他のシステム全体の設定ファイルとなるかもしれません。
<envar>PGLOCALEDIR</envar> sets the directory containing the
<literal>locale</literal> files for message localization.
PGLOCALEDIRはメッセージローカライゼーション用のlocaleファイルがあるディレクトリを設定します。