Postgres95 installation.

 -  Postgres95  has to be installed on one machine. You can access that Postgres from other machines, but is has to be installed on one. This is your server machine.
 
 -  Login as root.
 
 -  Create a user account named postgres if it does not yet exist on your system, with home directory /usr/local/postgres95. The most convenient way to do this is with /NextAdmin/UserManager. See the System Administration manual for details. 
 
    Note: the user postgres has to be installed as a local user, not a network user. If you do not install user postgres as local, the init scripts from the installer package will fail.
 
 -  Install the postgres95Server package.  This will install the postgres executables, and creates the initial database if it does not yet exist, in /usr/local/postgres95 by default.
 
    Note: the home directory of user postgres should be the same as the directory you install postgres95Server and postgres95Libs in.

 -  Install the postgres95Client package.  This will install the postgres95 client programs, monitor and psql, in /usr/local/postgres95 by default.  You are free, however, to install these somewhere else (e.g. to make these accessible to other machines in your network.). Don't worry if you get an overwrite warning from Installer when installing in the same location as the server package. This is because monitor is also part of the postgres95Server package. Both are equivalent.

 -  Install the postgres95Libs package.  This will install the pq library, manual pages, and other documentation, in /usr/local/postgres95 by default.  If you plan to create multi-architecture client programs, you should install it as a multi-architecture library.
 
 -  If you do not use /usr/local/postgres95 for the home directory of postgres, you have to set the PGHOME environment variable. It's all in the documentation, anyway, which we advice you to read thorougly. The documentation can be found in the doc and man subdirectories. The documentation is not really up to date. (specifically, the manual pages.)

Checking the installation

    We assume that you use the default setting for the postgres home directory. Furthermore we assume the use of a csh-like shell, where ~postgres denotes the home directory of user postgres.
 
 -  Login as postgres.

 -  Make sure that your path contains ~postgres/bin. NEXTSTEP differs from most Unix implementations with respect to default paths for executables. It normally adds ~/Unix/bin instead of ~/bin to the default execution path. 

 -  Make sure the postmaster is running. As user postgres enter
		postmaster &
     from the command line. The postmaster is the program that has to run before you can do anything useful with postgres. If you plan to use postgres on a regualr basis, you might enter a line to /etc/rc.local to start it up.

 -   It is best to make a user for postgres first. As user postgres enter
		createuser name
     from the command line. Answer the questions and a new user name will be available in the postgres rdbms. We advice you to make a postgres user with a name and id equal to your normal user account. So enter your login name for name above.

 -  Login as name (yourself).
 
 -  Before you can work with postgres, you have to make a database to work in. This database is copied from the templates and contains nothing except system administration. From the command line enter
		createdb foo
     and a database named foo will be created. Then run the psql command:
		psql foo
     And from psql enter:
		SELECT * FROM pg_user;
     And if all is well you will see a table of postgres users.  Enter ^D or \q followed by a return to quit psql.

     Here is how it looks for us after we have installed the packages:

     First we create a new user. Since my login is gerben I create a postgres user with the same name (and id). Since I am the main user, I grant myself all access.

    anyone@mr_ed 58) login postgres
    Password:
    postgres@mr_ed [/usr/local/postgres95] 3) set path = (/usr/local/postgres95/bin $path)
    postgres@mr_ed [/usr/local/postgres95] 5) rehash
    postgres@mr_ed [/usr/local/postgres95] 8) postmaster &
    [1] 463
    postgres@mr_ed [/usr/local/postgres95] 9) createuser gerben
    Enter user's postgres ID or RETURN to use unix user ID: 21 -> 
    Is user "gerben" allowed to create databases (y/n) y
    Is user "gerben" allowed to add users? (y/n) y
    /usr/local/postgres95/bin/createuser: gerben was successfully added

     Now we login as ourselves:

postgres@mr_ed [/usr/local/postgres95] 10) login gerben
Password:
gerben@mr_ed [~] 26) set path = (~postgres/bin $path)
gerben@mr_ed [~] 27) rehash
gerben@mr_ed [~] 29) createdb gerben
gerben@mr_ed [~] 30) psql gerben
Welcome to the POSTGRES95 interactive sql monitor:
  Please read the file COPYRIGHT for copyright terms of POSTGRES95

   type \? for help on slash commands
   type \q to quit
   type \g or terminate with semicolon to execute query
 You are currently connected to the database: gerben

gerben=> select * from pg_user
gerben=> ;
-------------------------------------------------------------------------------------
| usename     | usesysid    | usecreatedb | usetrace    | usesuper    | usecatupd   |
-------------------------------------------------------------------------------------
| postgres    | 666         | t           | t           | t           | t           |
-------------------------------------------------------------------------------------
| gerben      | 21          | t           | t           | t           | t           |
-------------------------------------------------------------------------------------
gerben=> \q
gerben@mr_ed [~] 31)

 -  There is a mailing list for postgres95. To join, send a message with subject "ADD" to postgres95-request@postgres95.vnet.net. To unsubscribe, send a message with subject "DEL" (both without the quotes).
 
 We wish you success with postgres95.

 R&A  --  1996/02/24