↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Unsupported versions: 6.3
Historical version. PostgreSQL 6.3 has reached end of support. See the current manual.
PostgreSQL
PrevChapter 44. libpqNext

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.


PrevHomeNext
libpqUpDatabase Connection Functions

Report a documentation issue

Read the upstream documentation. For corrections, first check the current manual.