<Chapter>
<Title>Setting Up Your Environment</Title>

<Para>
     This section discusses how to set up
     your own environment  so  that  you  can  use  frontend
     applications.  We assume <ProductName>Postgres</ProductName> has already been 
     successfully installed and started; refer to the Administrator's Guide
and the installation  notes
     for how to install Postgres.
</Para>

<Para>
<ProductName>Postgres</ProductName> is a client/server application. As a user,
you only need access to the client portions of the installation (an example
of a client application is the interactive monitor <Application>psql</Application>).
     For simplicity,
     we will assume that <ProductName>Postgres</ProductName> has been installed in  the
     directory  <FileName>/usr/local/pgsql</FileName>.   Therefore, wherever
     you see the directory <FileName>/usr/local/pgsql</FileName> you  should
     substitute  the name of the directory where <ProductName>Postgres</ProductName> is
     actually installed.
     All <ProductName>Postgres</ProductName> commands are installed  in  the  directory
     <FileName>/usr/local/pgsql/bin</FileName>.   Therefore,  you should add
     this directory to your shell command path.  If you  use
     a variant of the Berkeley C shell, such as <Application>csh</Application> or <Application>tcsh</Application>,
     you would add
<ProgramListing>
set path = ( /usr/local/pgsql/bin path )
</ProgramListing>
     in the <FileName>.login</FileName> file in your home directory.  If you  use
     a  variant  of  the  Bourne  shell, such as <Application>sh</Application>, <Application>ksh</Application>, or
     <Application>bash</Application>, then you would add
<ProgramListing>
PATH=/usr/local/pgsql/bin PATH
export PATH
</ProgramListing>
     to the <FileName>.profile</FileName> file in your home directory.
     From now on, we will assume that  you  have  added  the
     <ProductName>Postgres</ProductName>  bin  directory to your path.  In addition, we
     will make frequent reference to <Quote>setting a shell  
     variable</Quote>  or  <Quote>setting an environment variable</Quote> throughout
     this document.  If you did  not  fully  understand  the
     last  paragraph  on  modifying  your  search  path, you
     should consult the UNIX manual pages that describe your
     shell before going any further.
</Para>

<Para>
If your site administrator has not set things up in the
default  way,  you may have some more work to do.  For example, if the database
 server machine is a remote machine, you
will need to set the <Acronym>PGHOST</Acronym> environment variable to the name
of the database server machine.   The  environment  variable
<Acronym>PGPORT</Acronym> may also have to be set.  The bottom line is this: if
you try to start an application  program  and  it  complains
that it cannot connect to the <Application>postmaster</Application>,
 you should immediately consult your site administrator to make sure that your
environment is properly set up.
</Para>

</Chapter>
