Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

PostgreSQL Environment Variables

The following environment variables can be used to select default connection parameter values, which will be used by PQconnectdbPQsetdbLogin and 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.
  • PGHOST behaves the same as the host connection parameter.
  • PGHOSTADDR behaves the same as the hostaddr connection parameter. This can be set instead of or in addition to PGHOST to avoid DNS lookup overhead.
  • PGPORT behaves the same as the port connection parameter.
  • PGDATABASE behaves the same as the dbname connection parameter.
  • PGUSER behaves the same as the user connection parameter.
  • PGPASSWORD behaves the same as the 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 ps; instead consider using the ~/.pgpass file (see the link).
  • PGPASSFILE specifies the name of the password file to use for lookups. If not set, it defaults to ~/.pgpass (see link).
  • PGSERVICE behaves the same as the service connection parameter.
  • PGSERVICEFILE specifies the name of the per-user connection service file. If not set, it defaults to ~/.pg_service.conf (see LINK).
  • PGOPTIONS behaves the same as the options connection parameter.
  • PGAPPNAME behaves the same as the application_name connection parameter.
  • PGSSLMODE behaves the same as the sslmode connection parameter.
  • PGREQUIRESSL behaves the same as the requiressl connection parameter. This environment variable is deprecated in favor of the PGSSLMODE variable; setting both variables suppresses the effect of this one.
  • PGSSLCOMPRESSION behaves the same as the sslcompression connection parameter.
  • PGSSLCERT behaves the same as the sslcert connection parameter.
  • PGSSLKEY behaves the same as the sslkey connection parameter.
  • PGSSLROOTCERT behaves the same as the sslrootcert connection parameter.
  • PGSSLCRL behaves the same as the sslcrl connection parameter.
  • PGREQUIREPEER behaves the same as the requirepeer connection parameter.
  • PGKRBSRVNAME behaves the same as the krbsrvname connection parameter.
  • PGGSSLIB behaves the same as the gsslib connection parameter.
  • PGCONNECT_TIMEOUT behaves the same as the connect_timeout connection parameter.
  • PGCLIENTENCODING behaves the same as the client_encoding connection parameter.
The following environment variables can be used to specify default behavior for each PostgreSQL session. (See also the ALTER ROLE and ALTER 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 to SET datestyle TO ....)
  • PGTZ sets the default time zone. (Equivalent to SET timezone TO ....)
  • PGGEQO sets the default mode for the genetic query optimizer. (Equivalent to SET geqo TO ....)
Refer to the SQL command SET for information on correct values for these environment variables.
The following environment variables determine internal behavior of libpq; they override compiled-in defaults.
  • PGSYSCONFDIR sets the directory containing the pg_service.conf file and in a future version possibly other system-wide configuration files.
  • PGLOCALEDIR sets the directory containing the locale files for message localization.


Popular posts from this blog

rman interview and scenario based questions and answer and also rman(backup and recovery) discussions panel

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

7 Steps to configure BDR replication in postgresql

PostgreSQL pgBadger