This is the README for the source version of postgres.  There are two
methods, how you can get a source tree, which compiles under linux:

- Get the original postgres package from Berkeley:

	s2k-ftp.CS.Berkeley.EDU:pub/postgres/postgres-v4r2/postgres-v4r2.tar.Z

  and get the linux patch from any of the following ftp servers:

	marie.physik.tu-berlin.de:/pub/linux/postgres/4.2/pl1.diff.gz
	ftp.lysator.liu.se:/pub/linux/postgres/4.2/pl1.diff.gz
	tsx-11.mit.edu:/pub/linux/packages/postgres/4.2/pl1.diff.gz
	sunsite.unc.edu:/pub/linux/apps/database/postgres/4.2/pl1.diff.gz

- Get the linux source tree from one of the following:

	marie.physik.tu-berlin.de:/pub/linux/postgres/4.2/pl1.src.tar.gz
	ftp.lysator.liu.se:/pub/linux/postgres/4.2/pl1.src.tar.gz
	tsx-11.mit.edu:/pub/linux/packages/postgres/4.2/pl1.src.tar.gz
	sunsite.unc.edu:/pub/linux/apps/database/postgres/4.2/pl1.src.tar.gz

At a later point in time, the patch level may increment.

Dynamic loading of functions requires the dld library (latest version is
3.2.4) from tsx-11.mit.edu, directory /pub/linux/sources/libs or
/pub/linux/binaries/libs.  Install this library in /usr/lib and the
include files in /usr/include, or modify the main Postgres Makefiles to
represent where you put the library.

Make sure you do NOT have bash version 1.12.1 or earlier installed.
Bash version 1.12.1 which is part of Slackware-1.1.1 is known to produce
a segmentation fault when the Gen_creator.sh is run as part of the
Make-process. You can find the version number of bash by doing
	set | grep VERSION
Bash 1.13 and newer appear to behave normal and as expected.  You can
get bash from prep.ai.mit.edu, directory /pub/gnu/bash.  It is a plain
compile under Linux.

Victims of outdated distributions may have to upgrade their awk and/or
sed.  Make sure, you have at least awk 2.14 (awk's version is tested via
"awk -W version") and sed 2.?? (test via "sed -V").  Sed 1.13 is known
to work, too, but is very slow, when processing the results of the
regression test.  Again, the source code of these utilities can be found
on prep.ai.mit.edu or any other GNU server.

I have done all the tests in src/regress/demo and src/regress/regress.
The regression tests runs all the way through.  When comparing the
results, there are a few deviances:
- linux does not return an underflow error when parsing numbers such
  as: 1e-400, which is too small for an double.
- the adt stuff does not seem to work correctly.

To install, create a user named "postgres", and give him the home
directory /usr/local/postgres.  Login as "postgres", and unpack the
Postgres distribution in the home dir.

You first have to make a new Berkeley make utility.  So cd into
~/src/tools/bmake, and type:

	bmake
	bmake install
or
	./Bootstrap linux

depending, on whether you already have bmake from earlier versions.  You
must be root to run the "Bootstrap" script successfully, because it will
try to install the newly generated bmake.  Please note, that the bmake
as distributed wihth Postgres 4.1 for Linux is somewhat broken, so it
will choke out on a compile of Postgres 4.2.  However, it is stable
enough to re-compile itself.

While bmake is being made, it is a good time to read the postgres
installation instruction, as provided by the makers of postgres.  It
is in one of the following files, depending on which documentation
package (ascii, postscript, *roff source) you choose:

	~/doc/postgres-setup.cat
	~/doc/postgres-setup.ps
	~/src/doc/postgres-setup.me

After bmake has been compiled and installed, cd into the ~/src dir, and
start bmake (C-Shell users should run "rehash" before "bmake", to
re-read the information about the available binaries!) You will get lots
of warnings, but hopefully no errors.  Postgres uses several shell
scripts doing the build process, and these are very likely to catch bugs
in either of awk, sed and bash, see the warnings above about the
versions you need.

Finally do an "bmake install".  To see an demo of features of Postgres,
cd into ~/src/regress/demo, and type:

	 ~/bin/postmaster &
	 bmake runtest


Have fun!


Kai
wpp@marie.physik.tu-berlin.de
