Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
31.14. Environment Variables
Prev UpChapter 31. libpq - C LibraryHome Next

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).

  • 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. This environment variable is deprecated in favor of thePGSSLMODE variable; setting both variables suppresses the effect of this one.

  • 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 eachPostgres Pro 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 localization.


Prev Up Next
31.13. Event System Home 31.15. The Password File
pdfepub
Go to Postgres Pro Standard 9.5
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp