Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > fc62ce67f262cdcd253dc7f849ce3223 > files > 352

postgresql8.4-docs-8.4.12-0.1mdv2010.2.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Environment Variables</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 8.4.12 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="libpq - C Library"
HREF="libpq.html"><LINK
REL="PREVIOUS"
TITLE="Event System"
HREF="libpq-events.html"><LINK
REL="NEXT"
TITLE="The Password File"
HREF="libpq-pgpass.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2012-05-31T23:30:11"></HEAD
><BODY
CLASS="SECT1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
>PostgreSQL 8.4.12 Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="libpq-events.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="libpq.html"
>Fast Backward</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
>Chapter 30. <SPAN
CLASS="APPLICATION"
>libpq</SPAN
> - C Library</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="libpq.html"
>Fast Forward</A
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="libpq-pgpass.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="LIBPQ-ENVARS"
>30.13. Environment Variables</A
></H1
><A
NAME="AEN35662"
></A
><P
>   The following environment variables can be used to select default
   connection parameter values, which will be used by
   <CODE
CLASS="FUNCTION"
>PQconnectdb</CODE
>, <CODE
CLASS="FUNCTION"
>PQsetdbLogin</CODE
> and
   <CODE
CLASS="FUNCTION"
>PQsetdb</CODE
> 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.

   <P
></P
></P><UL
><LI
><P
>      <A
NAME="AEN35671"
></A
>
      <TT
CLASS="ENVAR"
>PGHOST</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-HOST"
>host</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35678"
></A
>
      <TT
CLASS="ENVAR"
>PGHOSTADDR</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-HOSTADDR"
>hostaddr</A
> connection parameter.
      This can be set instead of or in addition to <TT
CLASS="ENVAR"
>PGHOST</TT
>
      to avoid DNS lookup overhead.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35686"
></A
>
      <TT
CLASS="ENVAR"
>PGPORT</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-PORT"
>port</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35693"
></A
>
      <TT
CLASS="ENVAR"
>PGDATABASE</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-DBNAME"
>dbname</A
> connection parameter.
      </P
></LI
><LI
><P
>      <A
NAME="AEN35700"
></A
>
      <TT
CLASS="ENVAR"
>PGUSER</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-USER"
>user</A
> connection parameter.
      database.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35707"
></A
>
      <TT
CLASS="ENVAR"
>PGPASSWORD</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-PASSWORD"
>password</A
> connection parameter.
      Use of this environment variable
      is not recommended for security reasons (some operating systems
      allow non-root users to see process environment variables via
      <SPAN
CLASS="APPLICATION"
>ps</SPAN
>); instead consider using the
      <TT
CLASS="FILENAME"
>~/.pgpass</TT
> file (see <A
HREF="libpq-pgpass.html"
>Section 30.14</A
>).
     </P
></LI
><LI
><P
>      <A
NAME="AEN35717"
></A
>
      <TT
CLASS="ENVAR"
>PGPASSFILE</TT
> specifies the name of the password file to
      use for lookups.  If not set, it defaults to <TT
CLASS="FILENAME"
>~/.pgpass</TT
>
      (see <A
HREF="libpq-pgpass.html"
>Section 30.14</A
>).
     </P
></LI
><LI
><P
>      <A
NAME="AEN35725"
></A
>
      <TT
CLASS="ENVAR"
>PGSERVICE</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-SERVICE"
>service</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35732"
></A
>
      <TT
CLASS="ENVAR"
>PGREALM</TT
> sets the Kerberos realm to use with
      <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>, if  it is different from the
      local realm.  If <TT
CLASS="ENVAR"
>PGREALM</TT
> is set,
      <SPAN
CLASS="APPLICATION"
>libpq</SPAN
> 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
      selected by the server.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35741"
></A
>
      <TT
CLASS="ENVAR"
>PGOPTIONS</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-OPTIONS"
>options</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35748"
></A
>
      <TT
CLASS="ENVAR"
>PGSSLMODE</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-SSLMODE"
>sslmode</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35755"
></A
>
      <TT
CLASS="ENVAR"
>PGREQUIRESSL</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-REQUIRESSL"
>requiressl</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35762"
></A
>
      <TT
CLASS="ENVAR"
>PGSSLCERT</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-SSLCERT"
>sslcert</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35769"
></A
>
      <TT
CLASS="ENVAR"
>PGSSLKEY</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-SSLKEY"
>sslkey</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35776"
></A
>
      <TT
CLASS="ENVAR"
>PGSSLROOTCERT</TT
>  behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-SSLROOTCERT"
>sslrootcert</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35783"
></A
>
      <TT
CLASS="ENVAR"
>PGSSLCRL</TT
>  behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-SSLCRL"
>sslcrl</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35790"
></A
>
      <TT
CLASS="ENVAR"
>PGKRBSRVNAME</TT
>  behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-KRBSRVNAME"
>krbsrvname</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35797"
></A
>
      <TT
CLASS="ENVAR"
>PGGSSLIB</TT
> behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-GSSLIB"
>gsslib</A
> connection parameter.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35804"
></A
>
      <TT
CLASS="ENVAR"
>PGCONNECT_TIMEOUT</TT
>  behaves the same as <A
HREF="libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT"
>connect_timeout</A
> connection parameter.
     </P
></LI
></UL
><P>
  </P
><P
>   The following environment variables can be used to specify default
   behavior for each <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> session.  (See
   also the <A
HREF="sql-alteruser.html"
><I
>ALTER USER</I
></A
>
   and <A
HREF="sql-alterdatabase.html"
><I
>ALTER DATABASE</I
></A
>
   commands for ways to set default behavior on a per-user or per-database
   basis.)

   <P
></P
></P><UL
><LI
><P
>      <A
NAME="AEN35816"
></A
>
      <TT
CLASS="ENVAR"
>PGDATESTYLE</TT
> sets the default style of date/time
      representation.  (Equivalent to <TT
CLASS="LITERAL"
>SET datestyle TO
      ...</TT
>.)
     </P
></LI
><LI
><P
>      <A
NAME="AEN35823"
></A
>
      <TT
CLASS="ENVAR"
>PGTZ</TT
> sets the default time zone.  (Equivalent to
      <TT
CLASS="LITERAL"
>SET timezone TO ...</TT
>.)
     </P
></LI
><LI
><P
>      <A
NAME="AEN35830"
></A
>
      <TT
CLASS="ENVAR"
>PGCLIENTENCODING</TT
> sets the default client character
      set encoding.  (Equivalent to <TT
CLASS="LITERAL"
>SET client_encoding TO
      ...</TT
>.)
     </P
></LI
><LI
><P
>      <A
NAME="AEN35837"
></A
>
      <TT
CLASS="ENVAR"
>PGGEQO</TT
> sets the default mode for the genetic query
      optimizer.  (Equivalent to <TT
CLASS="LITERAL"
>SET geqo TO ...</TT
>.)
     </P
></LI
></UL
><P>

   Refer to the <ACRONYM
CLASS="ACRONYM"
>SQL</ACRONYM
> command <A
HREF="sql-set.html"
><I
>SET</I
></A
> for information on correct values for these
   environment variables.
  </P
><P
>   The following environment variables determine internal behavior of
   <SPAN
CLASS="APPLICATION"
>libpq</SPAN
>; they override compiled-in defaults.

   <P
></P
></P><UL
><LI
><P
>      <A
NAME="AEN35849"
></A
>
      <TT
CLASS="ENVAR"
>PGSYSCONFDIR</TT
> sets the directory containing the
      <TT
CLASS="FILENAME"
>pg_service.conf</TT
> file.
     </P
></LI
><LI
><P
>      <A
NAME="AEN35856"
></A
>
      <TT
CLASS="ENVAR"
>PGLOCALEDIR</TT
> sets the directory containing the
      <TT
CLASS="LITERAL"
>locale</TT
> files for message internationalization.
     </P
></LI
></UL
><P>
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="libpq-events.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="libpq-pgpass.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Event System</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="libpq.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The Password File</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>