This page in other versions: Unsupported versions: 6.3
Prev Chapter 40. 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

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group