
POSTGRES95 INSTALLATION INSTRUCTIONS
Copyright (c) 1995 Regents of the University of California

This directory contains the source and documentation for Postgres95 (beta
release). Postgres95 is a derivative of POSTGRES 4.2 (the last official
release). It is developed by Jolly Chen and Andrew Yu.

Postgres95 has been tested on the following platforms:

 *  Digital Equipment Alpha running DEC OSF/1 2.1 and 3.0 (with gcc and cc).

 *  Digital Equipment DECstation running Ultrix 4.4 (with gcc and cc).

 *  Hewlett-Packard H-P 9000 Series 800 (PA-RISC architecture) 
    machines running HP-UX 9.00, 9.01 and 9.03 (with cc).

 *  Sun Microsystems (SPARC architecture) machines running SunOS 4.1.3_U1,
    and Solaris 2.4 (with gcc).

You should have at least 8 MB of memory and at least 50 MB of disk space to
hold the source, binaries, and user databases.

----------------------------------------------------------------------
To install Postgres95 on UNIX platforms:

1. Create the postgres login.
   
   Create a login called postgres (this requires root privileges). We 
   recommend that you run the postmaster as the user postgres for security 
   reasons.

   If you run the postmaster as yourself, be warned that you essentially
   grant all database users the ability to execute arbitrary C functions
   as you without your password. (In any case, DO NOT run the postmaster 
   as root.)

2. Compile and install Postgres95.

   If you have earlier versions of Postgres installed, you might want
   to install Postgres95 in a different place.

   If you're installing Postgres95 on Ultrix 4.x or Linux, see the 
   porting notes at the end for additional packages that you need to install
   before installing Postgres95.

   Our Makefiles require GNU make (gmake) and also assume that "install"
   accepts BSD options. The INSTALL variable in the Makefiles is set to the 
   BSD-compatible version of install. However, on HP-UX, you will have to 
   find a BSD-compatible installation program and set INSTALL (in
   src/mk/port/postgres.mk.hpux) to the location of this program. (eg.
   bsdinst, which comes with the MIT X Window System distribution)

   Customization can be done by editing src/Makefile.global. You may change
   the various configuration options here, such as where the Postgres95
   executable files are installed and where postgres looks for the database
   directory.  The configuration switches are fairly self-explanatory, but we
   will go over some of the more commonly-changed options:

     -  PORTNAME specifies the platform on which Postgres95 is being build
        (alpha is the default). You might need to change it to reflect your 
        platform. (sparc for SunOS 4.1.x, sparc_solaris for Solaris 2.4, 
        ultrix4 for Ultrix 4.4, and hpux for HP-UX 9.0)

     -  POSTGRESLOGIN specifies the user who will be doing initdb and
        running the postmaster (defaults to postgres).

     -  POSTSGRESDIR specifies the top-level directory where Postgres95
        binaries, header files, libraries, and databases are installed.

     -  SRCDIR specifies where the source files are located. (defaults
        to $(POSTGRESDIR)/src.)

   After editing src/Makefile.global, you are ready to compile and
   install Postgres95 (it takes about half an hour on a Sparc 10):

     % cd src
     % gmake 
     % gmake install

   After the installation is complete, check that you have the following files
   in the top level Postgres95 directory (eg. /usr/local/postgres95).

   You will find the following executables in the bin directory (which
   should be included in the search path of your shell):

     % ls /usr/local/postgres95/bin
     cleardbdir*   destroydb*    monitor*      postgres*
     createdb*     destroyuser*  pg_id*        postmaster@
     createuser*   initdb*       pg_version*   psql*

   You will find the following in the database directory:

     % ls -R /usr/local/postgres95/data
     files/

     data/files:
     global1.bki                   local1_template1.bki
     global1.bki.source            local1_template1.bki.source

3. Initialize the database.

   After you have installed Postgres95, initialize the database by typing:

     % initdb

4. Start the postmaster.

   Now, you are ready to make the system operational by running the
   postmaster daemon. There are a few environment variables which affect
   its operation:
	PGDATA	- location of the database (eg. /usr/local/postgres95/data)
	PGPORT	- TCP port where it listens for connection (eg. 5432)
   You don't have to set these variables if you use the (compile time) 
   default.

     % postmaster -S

   
5. Testing.

   We suggest you run the regression tests to make sure the release
   was installed successfully. The regression tests can be found in
   src/test/regress. 

     % cd /usr/local/postgres95/src/test/regress
     % gmake all runtest

   This will run a whole slew of regression tests and might take a long
   time to run.  When it's done, the output is in the file obj/regress.out.
   You can compare this to a sample run that we supply in the file 
   sample.regress.out. (You should get the same output except for the 
   times of the error messages and the pathnames.)

     % diff obj/regress.out sample.regress.out

   The regression test takes about half an hour to run on a Sparc 10.

6. Run queries.

   After the database is initialized, you can create a new database. To
   create a database, do the following:

     % createdb foo

   To connect to the postmaster, you have a choice of two front-end programs.
   ("monitor" is the regular terminal monitor program supplied in earlier 
   versions of Postgres and "psql" is the new monitor program with
   GNU readline support.)
   
     % monitor foo
     Welcome to the POSTGRES95 terminal monitor

     Go
     *

----------------------------------------------------------------------

A note about psql: psql has hooks to support the GNU readline and history
libraries. However, we do not build psql with the two libraries by
default. Should you decide to use the GNU readline and history libraries,
you need to edit src/Makefile.global (for the location of the
libraries and set the USE_READLINE flag to true).

Porting Notes:
-------------
Ultrix4.x:
	You need to install the libdl-1.1 package since Ultrix 4.x doesn't
	have a dynamic loader. It's available in
	   s2k-ftp.CS.Berkeley.EDU:pub/personal/andrew/libdl-1.1.tar.Z

Linux:
	To compile the linux port, the dld library MUST be obtained and
	installed on the system. It enables dynamic link loading capability
	to the postgres port. The dld library can be obtained from the sunsite
	linux distributions. The current name is dld-3.2.5.
				(Jalon Q. Zimmerman 
				<sneaker@powergrid.electriciti.com> 5/11/95)

	If you're installing on Linux ELF, uncomment the line which
	says "LINUX_ELF = 1" in src/mk/port/postgres.mk.linux

