Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
PostgreSQL 9.4.1 Documentation
PrevUpChapter 31.libpq - C LibraryNext

31.14. Environment Variables

The following environment variables can be used to select default connection parameter values, which will be used byPQconnectdb,PQsetdbLogin andPQsetdb 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.

  • PGHOST behaves the same as thehost connection parameter.

  • PGHOSTADDR behaves the same as thehostaddr connection parameter. This can be set instead of or in addition toPGHOST to avoid DNS lookup overhead.

  • PGPORT behaves the same as theport connection parameter.

  • PGDATABASE behaves the same as thedbname connection parameter.

  • PGUSER behaves the same as theuser connection parameter.

  • PGPASSWORD behaves the same as thepassword 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 viaps; instead consider using the~/.pgpass file (seeSection 31.15).

  • PGPASSFILE specifies the name of the password file to use for lookups. If not set, it defaults to~/.pgpass (seeSection 31.15).

  • PGSERVICE behaves the same as theservice connection parameter.

  • PGSERVICEFILE specifies the name of the per-user connection service file. If not set, it defaults to~/.pg_service.conf (seeSection 31.16).

  • PGREALM sets the Kerberos realm to use withPostgreSQL, if it is different from the local realm. IfPGREALM is set,libpq applications will attempt authentication with servers for this realm and use separate ticket files to avoid conflicts with local ticket files. This environment variable is only used if GSSAPI authentication is selected by the server.

  • PGOPTIONS behaves the same as theoptions connection parameter.

  • PGAPPNAME behaves the same as theapplication_name connection parameter.

  • PGSSLMODE behaves the same as thesslmode connection parameter.

  • PGREQUIRESSL behaves the same as therequiressl connection parameter.

  • PGSSLCOMPRESSION behaves the same as thesslcompression connection parameter.

  • PGSSLCERT behaves the same as thesslcert connection parameter.

  • PGSSLKEY behaves the same as thesslkey connection parameter.

  • PGSSLROOTCERT behaves the same as thesslrootcert connection parameter.

  • PGSSLCRL behaves the same as thesslcrl connection parameter.

  • PGREQUIREPEER behaves the same as therequirepeer connection parameter.

  • PGKRBSRVNAME behaves the same as thekrbsrvname connection parameter.

  • PGGSSLIB behaves the same as thegsslib connection parameter.

  • PGCONNECT_TIMEOUT behaves the same as theconnect_timeout connection parameter.

  • PGCLIENTENCODING behaves the same as theclient_encoding connection parameter.

The following environment variables can be used to specify default behavior for eachPostgreSQL session. (See also theALTER ROLE andALTER DATABASE commands for ways to set default behavior on a per-user or per-database basis.)

  • PGDATESTYLE sets the default style of date/time representation. (Equivalent toSET datestyle TO ....)

  • PGTZ sets the default time zone. (Equivalent toSET timezone TO ....)

  • PGGEQO sets the default mode for the genetic query optimizer. (Equivalent toSET geqo TO ....)

Refer to theSQL commandSET for information on correct values for these environment variables.

The following environment variables determine internal behavior oflibpq; they override compiled-in defaults.

  • PGSYSCONFDIR sets the directory containing thepg_service.conf file and in a future version possibly other system-wide configuration files.

  • PGLOCALEDIR sets the directory containing thelocale files for message internationalization.


PrevHomeNext
Event SystemUpThe Password File
Go to PostgreSQL 9.4
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp