Unsupported versions: 6.3
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.
PostgreSQL
Prev Chapter 44. libpq Next

Control and Initialization

The following environment variables can be used to set up default environment values to avoid hard-coding database names into an application program:

  • PGHOST sets the default server name.

  • PGOPTIONS sets additional runtime options for the Postgres backend.

  • PGPORT sets the default port for communicating with the Postgres backend.

  • PGTTY sets the file or tty on which debugging messages from the backend server are displayed.

  • PGDATABASE sets the default Postgres database name.

  • PGREALM sets the Kerberos realm to use with Postgres, if it is different from the local realm. If PGREALM is set, Postgres 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 Kerberos authentication is enabled.


Prev Home Next
libpq Up Database Connection Functions