head	1.8;
access;
symbols
	REL7_1_BETA3:1.7
	REL7_1_BETA2:1.7
	REL7_1:1.7
	REL7_0_PATCHES:1.5.0.2
	REL7_0:1.5
	REL6_5_PATCHES:1.3.0.2
	REL6_5:1.3
	REL6_4:1.2.0.2
	release-6-3:1.1;
locks; strict;
comment	@# @;


1.8
date	2001.02.04.15.28.18;	author petere;	state dead;
branches;
next	1.7;

1.7
date	2000.11.30.23.20.50;	author tgl;	state Exp;
branches;
next	1.6;

1.6
date	2000.11.13.15.18.07;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	2000.05.02.20.01.51;	author thomas;	state Exp;
branches;
next	1.4;

1.4
date	99.10.04.15.18.54;	author thomas;	state Exp;
branches;
next	1.3;

1.3
date	99.05.04.02.57.12;	author thomas;	state Exp;
branches;
next	1.2;

1.2
date	98.07.29.06.49.58;	author thomas;	state Exp;
branches;
next	1.1;

1.1
date	98.03.01.08.15.51;	author thomas;	state Exp;
branches;
next	;


desc
@@


1.8
log
@Move PL docs to programmer's guide, "storage" chapter to admin guide,
clean up some things in the affected areas.
@
text
@<Chapter Id="environ">
<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 "setting a shell  
     variable"  or  "setting an environment variable" 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>
@


1.7
log
@Repair residual sillinesses from UUNET virtual host/socket path patch.
I hope all the dust has settled out now ...
@
text
@@


1.6
log
@UUNET is looking into offering PostgreSQL as a part of a managed web
hosting product, on both shared and dedicated machines.  We currently
offer Oracle and MySQL, and it would be a nice middle-ground.
However, as shipped, PostgreSQL lacks the following features we need
that MySQL has:

1. The ability to listen only on a particular IP address.  Each
   hosting customer has their own IP address, on which all of their
   servers (http, ftp, real media, etc.) run.
2. The ability to place the Unix-domain socket in a mode 700 directory.
   This allows us to automatically create an empty database, with an
   empty DBA password, for new or upgrading customers without having
   to interactively set a DBA password and communicate it to (or from)
   the customer.  This in turn cuts down our install and upgrade times.
3. The ability to connect to the Unix-domain socket from within a
   change-rooted environment.  We run CGI programs chrooted to the
   user's home directory, which is another reason why we need to be
   able to specify where the Unix-domain socket is, instead of /tmp.
4. The ability to, if run as root, open a pid file in /var/run as
   root, and then setuid to the desired user.  (mysqld -u can almost
   do this; I had to patch it, too).

The patch below fixes problem 1-3.  I plan to address #4, also, but
haven't done so yet.  These diffs are big enough that they should give
the PG development team something to think about in the meantime :-)
Also, I'm about to leave for 2 weeks' vacation, so I thought I'd get
out what I have, which works (for the problems it tackles), now.

With these changes, we can set up and run PostgreSQL with scripts the
same way we can with apache or proftpd or mysql.

In summary, this patch makes the following enhancements:

1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT,
   and command line options -k --unix-socket to the relevant programs.
2. Adds a -h option to postmaster to set the hostname or IP address to
   listen on instead of the default INADDR_ANY.
3. Extends some library interfaces to support the above.
4. Fixes a few memory leaks in PQconnectdb().

The default behavior is unchanged from stock 7.0.2; if you don't use
any of these new features, they don't change the operation.

David J. MacKenzie
@
text
@d50 11
a60 12

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> or <envar>PGUNIXSOCKET</envar> 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>
@


1.5
log
@Fixups in content and markup for 7.0 release.
@
text
@d50 12
a61 11
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>
@


1.4
log
@Expunge "UNIX" in favor of "Unix".
A few other changes, but I forget what :(
@
text
@d41 2
a42 2
     will make frequent reference to <Quote>setting a shell  
     variable</Quote>  or  <Quote>setting an environment variable</Quote> throughout
@


1.3
log
@Fix up examples of sh/ksh PATH environment variable definition.
@
text
@d45 1
a45 1
     should consult the UNIX manual pages that describe your
@


1.2
log
@Add id field to chapter and book tags to allow output file names
 to be meaningful.
@
text
@d35 2
a36 2
PATH=/usr/local/pgsql/bin PATH
export PATH
@


1.1
log
@SGML source for new documentation.
@
text
@d1 1
a1 1
<Chapter>
@

