cvsdist 6f2c3a9
README.rpm-dist
cvsdist 6f2c3a9
-----------------------------------------------------------------------------
d6ea25d
Version 8.2, for the PostgreSQL 8.2.1-2 RPMset.
d6ea25d
Devrim Gündüz <devrim@CommandPrompt.com>, Lamar Owen <lowen@pari.edu>
cvsdist 5a04de7
-----------------------------------------------------------------------------
cvsdist 6f2c3a9
cvsdist 6f2c3a9
Contents:
6e96691
 0.)	Quick note about '-i'
cvsdist 6f2c3a9
 1.)	Introduction, QuickStart, and credits
cvsdist 6f2c3a9
 2.)	PostgreSQL RPM packages and rationale
cvsdist 06e8d17
 3.)	Starting multiple postmasters
cvsdist 6f2c3a9
 4.)	Regression Testing
cvsdist 6f2c3a9
 5.)	Starting postmaster automatically on startup
6e96691
 6.)	Grand Unified Configuration(GUC) File
6e96691
 7.)	Logging set up
6e96691
 8.)	Rebuilding from the source RPM
6e96691
 9.)	Contrib files
cvsdist 6f2c3a9
10.)	Further Information Resource
cvsdist 6f2c3a9
6e96691
QUICK NOTE ABOUT '-i'
cvsdist 6f2c3a9
-----------------------------------------------------------------------------
cvsdist 6f2c3a9
The postmaster '-i' option is NOT used by default in the initscript shipped
cvsdist 6f2c3a9
with these RPMs.  Please do NOT modify the initscript to add the '-i' back
cvsdist 6f2c3a9
in -- it will get overwritten on the next package upgrade.  Rather, see the
cvsdist 6f2c3a9
section below on the Grand Unified Configuration file, which includes the
d3e4ca4
recommended way to get '-i' functionality.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
INTRODUCTION
cvsdist 6f2c3a9
-----------------------------------------------------------------------------
6e96691
This document exists to explain the layout of the RPMs for PostgreSQL, to 
cvsdist 06e8d17
describe various RPM specifics, and to document special features found
cvsdist 06e8d17
in the RPMset.
cvsdist 6f2c3a9
d6ea25d
This document is written to be applicable to version 8.2 of PostgreSQL, 
6e96691
which is the current version of the RPMs as of this writing. More to the 
d6ea25d
point, versions prior to 8.2 are not documented here.
cvsdist 6f2c3a9
6e96691
Official PostgreSQL Global Development Group RPMs have from version 7.1.2
6e96691
on carried a 'PGDG' after the release number.  Other RPMsets distributed
cvsdist 06e8d17
with Linux distributions may have a different release number and initials.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
It is preferable for the distribution-specific set to be the one used, as
cvsdist 6f2c3a9
the PGDG set is intentionally generic.  So, if your distro has a set of RPMs,
cvsdist 6f2c3a9
use them in preference.  If you want to stay up-to-date on the PostgreSQL
cvsdist 6f2c3a9
core itself, use the PGDG generic set -- but understand that it is a 
cvsdist 06e8d17
GENERIC set.
cvsdist 6f2c3a9
cvsdist 06e8d17
These RPMs no longer support any sort of upgrading process other than that
cvsdist 06e8d17
documented in the regular documentation.  That is, you must dump, upgrade,
6e96691
initdb, and restore your data.  Dump first, then remove the old server
6e96691
subpackage, install the new package, and restore the data from dump. (A new
6e96691
method of running multiple versions of PostgreSQL, along with the capability
6e96691
to run multiple postmasters, is in development, but was not ready for this
6e96691
release.)
cvsdist 06e8d17
6e96691
SuSE has maintained their own RPMset for some time -- their documentation
6e96691
supercedes any found in this file.
cvsdist 06e8d17
cvsdist 6f2c3a9
QUICKSTART
cvsdist 6f2c3a9
-----------------------------------------------------------------------------
cvsdist 06e8d17
For a fresh installation on a recent Red Hat or similar system, a simple
6e96691
	service postgresql start
cvsdist 06e8d17
as root will prepare a new database (initdb), and start a postmaster that
6e96691
will listen on localhost and Unix socket 5432 only.  Edit
6e96691
/var/lib/pgsql/data/postgresql.conf and pg_hba.conf if you want to allow
6e96691
remote access -- see the section on Grand Unified Configuration.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
The file /var/lib/pgsql/.bash_profile is now packaged to help with the 
cvsdist 6f2c3a9
setting of environment variables. You may edit this file, and it won't be
cvsdist 6f2c3a9
overwritten during an upgrade.  However, enhancements and bugfixes may be added
cvsdist 6f2c3a9
to this file, so be sure to check .bash_profile.rpmnew after upgrading.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
The user 'postgres' is created during installation of the server subpackage.
cvsdist 6f2c3a9
This user by default is UID and GID 26. The user has the default shell set to
cvsdist 6f2c3a9
bash, and the home directory set to /var/lib/pgsql.  This user also has no
6e96691
default password -- in order to be able to su to it from a non-root account
cvsdist 6f2c3a9
or login as 'postgres' you will need to set a password using passwd.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
CREDITS
cvsdist 6f2c3a9
-----------------------------------------------------------------------------
cvsdist 6f2c3a9
Thomas Lockhart
cvsdist 6f2c3a9
Uncle George
cvsdist 6f2c3a9
Ryan Kirkpatrick
cvsdist 06e8d17
Trond Eivind Glomsrd
cvsdist 6f2c3a9
Mark Knox
cvsdist 6f2c3a9
Mike Mascari
cvsdist 6f2c3a9
Nicolas Huillard
cvsdist 6f2c3a9
Karl DeBisschop
cvsdist 6f2c3a9
Roger Luethi
cvsdist 68d4798
Jeff Johnson
cvsdist 6f2c3a9
Reinhard Max
cvsdist 9636c11
Peter Eisentraut
cvsdist 06e8d17
Joe Conway
cvsdist c205ec8
Andrew Overholt
cvsdist c205ec8
David Jee
cvsdist c205ec8
Kaj J. Niemi
d6ea25d
Devrim Gunduz
cvsdist 5a04de7
cvsdist 6f2c3a9
POSTGRESQL RPM PACKAGES AND RATIONALE.
cvsdist 6f2c3a9
-----------------------------------------------------------------------------
6e96691
PostgreSQL is split up into multiple packages so that users can 'pick and
6e96691
choose' what pieces are needed, and what dependencies are required.
6e96691
cvsdist 06e8d17
The RPMset is packaged in the following subpackages:
cvsdist 6f2c3a9
6e96691
postgresql:		Key clients and libraries, and documentation
6e96691
postgresql-libs:	Client shared libraries
cvsdist 6f2c3a9
postgresql-server:	Server executables and data files
6e96691
postgresql-devel:	Development libraries and include files
d6ea25d
postgresql-python:	The PyGreSQL client library
6e96691
postgresql-tcl:		Tcl client library (Pgtcl)
6e96691
postgresql-test:	The regression tests and associated files
6e96691
postgresql-docs:	Extra documentation, such as the tutorial files
6e96691
postgresql-contrib:	The contrib source tree, as well as selected binaries
d6ea25d
postgresql-plperl:	PL/Perl procedural language
d6ea25d
postgresql-plpython:	PL/Python procedural language
d6ea25d
postgresql-pltcl:	PL/Tcl procedural language
cvsdist 06e8d17
6e96691
You have to install postgresql and postgresql-libs to do anything.
6e96691
postgresql-server is needed unless you only plan to use the clients to work
6e96691
with a remote PostgreSQL server. The others are optional.
6e96691
d6ea25d
Note that there is no postgresql-perl, postgresql-jdbc, postgresql-odbc, or
d6ea25d
postgresql-tk package any longer.  This is due to these portions being split
d6ea25d
into separate source distributions.
cvsdist 6f2c3a9
d6ea25d
While PyGreSQL was split out from the core PostgreSQL distribution, thanks to
6e96691
Kaj's work it is still included as the python subpackage.  Also, Pgtcl is
6e96691
still included as the tcl subpackage, although it is not part of the core
6e96691
distribution anymore.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
RPM FILE LOCATIONS.
cvsdist 6f2c3a9
-----------------------------------------------------------------------------
6e96691
To be in compliance with the Linux FHS, the PostgreSQL RPMs install files in
6e96691
a manner not consistent with most of the PostgreSQL documentation.  According
6e96691
to the standard PostgreSQL documentation, PostgreSQL is installed under the
6e96691
directory /usr/local/pgsql, with executables, source, and data existing in
6e96691
various subdirectories.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
Different distributions have different ideas of some of these file locations.
cvsdist 6f2c3a9
In particular, the documentation directory can be /usr/doc, /usr/doc/packages,
cvsdist 6f2c3a9
/usr/share/doc, /usr/share/doc/packages, or some other similar path.  The
d6ea25d
Red Hat / Fedora Core locations are listed below.
cvsdist 6f2c3a9
6e96691
However, the RPMs install the files like this:
cvsdist 6f2c3a9
Executables:		/usr/bin
6e96691
Libraries:		/usr/lib
cvsdist 6f2c3a9
Documentation:		/usr/share/doc/postgresql-x.y.z
6e96691
Contrib documentation:	/usr/share/doc/postgresql-contrib-x.y.z
cvsdist 6f2c3a9
Source:			not installed
cvsdist 6f2c3a9
Data:			/var/lib/pgsql/data
cvsdist 6f2c3a9
Backup area:		/var/lib/pgsql/backup
cvsdist 6f2c3a9
Templates:		/usr/share/pgsql
cvsdist 6f2c3a9
Procedural Languages:	/usr/lib/pgsql
cvsdist 6f2c3a9
Development Headers:	/usr/include/pgsql
6e96691
Localization data:	/usr/share/locale
cvsdist 6f2c3a9
Other shared data:	/usr/share/pgsql
cvsdist 6f2c3a9
Regression tests:	/usr/lib/pgsql/test/regress  (in the -test package)
6e96691
Tutorial:		/usr/lib/pgsql/tutorial (in the -docs package)
6e96691
Extra documentation:	/usr/share/doc/postgresql-docs-x.y.z
cvsdist 6f2c3a9
6e96691
On some 64-bit architectures, /usr/lib64 is used instead of /usr/lib.
6e96691
d6ea25d
The above list describes the Red Hat / Fedora Core layout.  These locations
d6ea25d
may change for other distributions.  Use of 'rpm -ql' for each package is
6e96691
recommended as the 'official' information source.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
While it may seem gratuitous to place these files in different locations, the
cvsdist 6f2c3a9
FHS requires it -- distributions should not ever touch /usr/local.  It may
cvsdist 6f2c3a9
also seem like more work to keep track of where everything is -- but, that's
cvsdist 6f2c3a9
the beauty of RPM -- you don't have to keep track of the files, RPM does it
cvsdist 6f2c3a9
for you.
cvsdist 6f2c3a9
6e96691
These RPMs are designed to be LSB-compliant -- if you find this not to be the
d6ea25d
case, please let us know by way of the pgsqlrpms-hackers@pgfoundry.org
80b1cae
mailing list.
cvsdist 9636c11
cvsdist 06e8d17
MULTIPLE POSTMASTERS
cvsdist 6f2c3a9
-------------------------------------------------------------------------------
cvsdist 06e8d17
The postgresql-server RPM contains an 'initscript' that is used to start the
cvsdist 06e8d17
postmaster.  The current version of this script has logic to be able to start
cvsdist 06e8d17
multiple postmasters, with different data areas, listening on different ports,
cvsdist 06e8d17
etc.  To use this functionality requires root access.
cvsdist 06e8d17
cvsdist 06e8d17
As an example, let us create a secondary postmaster called, creatively enough,
cvsdist 06e8d17
'secondary'.  Here are the steps:
cvsdist 06e8d17
1.)	create a hard link in /etc/rc.d/init.d (or equivalent location)
cvsdist 06e8d17
	to postgresql named 'secondary' : ln postgresql secondary   Pick
cvsdist 06e8d17
	a name not already used in /etc/rc.d/init.d!
cvsdist 06e8d17
2.)	create a file in /etc/sysconfig/pgsql named secondary.  This file is
cvsdist 06e8d17
	a shell script -- typically you would define PGDATA, PGPORT, and PGOPTS
cvsdist 06e8d17
	here.  Since $PGDATA/postgresql.conf will override many of these
cvsdist 06e8d17
	settings, except PGDATA, you might be surprised on startup.
cvsdist 06e8d17
3.)	create the target PGDATA.
cvsdist 06e8d17
4.)	Initdb the targe PGDATA as documented in the main documentation.  
cvsdist 06e8d17
	Automatic initdb may or may not work for you, so a manual one is
cvsdist 06e8d17
	preferred.  This must be done as user 'postgres'
cvsdist 06e8d17
5.)	Edit postgresql.conf to change the port, address, tcpip settings, etc.
cvsdist 06e8d17
6.)	Start the postmaster with 'service secondary start'.
cvsdist 06e8d17
cvsdist 06e8d17
Note that there may be problems with the standard symlink -- consider this
cvsdist 06e8d17
support experimental at this point in time.
cvsdist 5a04de7
cvsdist 6f2c3a9
REGRESSION TESTING
cvsdist 6f2c3a9
-------------------------------------------------------------------------------
6e96691
If you install the postgresql-test RPM then you can run the PostgreSQL
cvsdist 6f2c3a9
regression tests.  These tests stress your database installation and produce
cvsdist 6f2c3a9
results that give you assurances that the installation is complete, and that
cvsdist 6f2c3a9
your database machine is up to the task.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
To run the regression tests under the RPM installation, make sure that
cvsdist 6f2c3a9
postmaster has been started (if not, su to root and execute the
6e96691
"/etc/rc.d/init.d/postgresql start" init script), cd to
6e96691
/usr/lib/pgsql/test/regress, su to postgres, and execute "make check".
6e96691
This command will start the regression tests and will both show the
cvsdist 6f2c3a9
results to the screen and store the results in the file regress.out.
cvsdist 6f2c3a9
6e96691
If any tests fail, see the file regression.diffs in that directory for details,
6e96691
and read the "Regression Tests" section of the PostgreSQL documentation to
6e96691
find out whether the differences are actually significant.  If you need help
9159183
interpreting the results, contact the pgsql-ports list at postgresql.org or
9159183
the pgsqlrpms-general list at pgfoundry.org.
cvsdist 6f2c3a9
6e96691
After testing, say "make clean" to remove the files generated by the test
6e96691
script.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
STARTING POSTMASTER AUTOMATICALLY AT SYSTEM STARTUP
cvsdist 6f2c3a9
-------------------------------------------------------------------------------
6e96691
Red Hat Linux uses the System V Init package.  A startup script for PostgreSQL
cvsdist 6f2c3a9
is provided in the server package, as /etc/rc.d/init.d/postgresql.  To start
cvsdist 68d4798
the postmaster, with sanity checking, as root, run
6e96691
	service postgresql start
6e96691
To shut the postmaster down,
6e96691
	service postgresql stop
6e96691
There are other possible commands to this script -- execute
6e96691
'service postgresql' for a listing.
6e96691
6e96691
To get this script to run at system startup or any time the system switches
6e96691
into runlevels 3, 4, or 5, run:
6e96691
	chkconfig --add postgresql
6e96691
	chkconfig --level 345 postgresql on
6e96691
and the proper symlinks will be created.  See the chkconfig man page for more
cvsdist 9636c11
information.  Note that this is manual -- while the startup script can include
cvsdist 9636c11
tags to allow chkconfig to automatically perform the symlinking, this is not
cvsdist 9636c11
done at this time.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
GRAND UNIFIED CONFIGURATION (GUC) FILE
cvsdist 6f2c3a9
-------------------------------------------------------------------------------
cvsdist 6f2c3a9
The PostgreSQL server has many tunable parameters -- the file 
cvsdist 6f2c3a9
/var/lib/pgsql/data/postgresql.conf is the master configuration file for the
cvsdist 6f2c3a9
whole system.  
cvsdist 6f2c3a9
cvsdist 6f2c3a9
The RPM ships with the default file -- you will need to tune the
cvsdist 6f2c3a9
parameters for your installation.  In particular, you might want to allow
6e96691
nonlocal TCP/IP socket connections -- in order to allow these, you will need
6e96691
to edit the postgresql.conf file.  The line in question contains the string 
6e96691
'listen_addresses' -- you need to both uncomment the line and set the value
6e96691
to '*' to get the postmaster to accept nonlocal connections.  You'll also need
6e96691
to adjust pg_hba.conf appropriately.
cvsdist 6f2c3a9
6e96691
LOGGING SET UP
6e96691
-------------------------------------------------------------------------------
6e96691
By default, the postmaster's stderr log is directed into files placed in a
6e96691
pg_log subdirectory of the data directory (ie, /var/lib/pgsql/data/pg_log).
6e96691
The out-of-the-box configuration rotates among seven files, one for each
6e96691
day of the week.  You can adjust this by changing postgresql.conf settings.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
REBUILDING FROM SOURCE RPM
cvsdist 6f2c3a9
-------------------------------------------------------------------------------
6e96691
If your distribution is not supported by the binary RPMs from PostgreSQL.org, 
cvsdist 6f2c3a9
you will need to rebuild from the source RPM.  Download the .src.rpm for this
cvsdist 6f2c3a9
release.  You will need to be root to rebuild, unless you have already set up
cvsdist 6f2c3a9
a non-root build environment.
cvsdist 6f2c3a9
80b1cae
Install the source RPM with rpm -i, then CD to the rpm building area (on Red
80b1cae
Hat or Fedora Core this is /usr/src/redhat by default).  You will have to have
80b1cae
a full development environment to rebuild the full RPM set.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
This release of the RPMset includes the ability to conditionally build 
cvsdist 6f2c3a9
sets of packages.  The parameters, their defaults, and the meanings are:
cvsdist 6f2c3a9
cvsdist 9636c11
beta		0	#build with cassert and do not strip the binaries
d6ea25d
python		1	#build the postgresql-python package.
cvsdist 6f2c3a9
tcl		1	#build the postgresql-tcl package.
cvsdist 6f2c3a9
test		1	#build the postgresql-test package.
d6ea25d
plpython	1	#build the PL/Python package
d6ea25d
pltcl		1	#build the PL/Tcl package.
d6ea25d
plperl		1	#build the PL/Perl package.
cvsdist 6f2c3a9
ssl		1	#use OpenSSL support.
cvsdist 6f2c3a9
kerberos	1	#use Kerberos 5 support.
cvsdist 9636c11
nls		1	#build with national language support.
cvsdist 06e8d17
pam		1	#build with PAM support.
6e96691
runselftest	1	#do "make check" during the build.
d3e4ca4
xml		1	#build contrib/xml2
d3e4ca4
pgfts		1	#build with --enable-thread-safety
cvsdist 6f2c3a9
cvsdist 6f2c3a9
To use these defines, invoke a rebuild like this:
d3e4ca4
rpmbuild --rebuild --define 'python 0' --define 'tcl 0' \
6e96691
	--define 'test 0' --define 'runselftest 1' --define 'kerberos 0' \
d6ea25d
	postgresql-8.2.1-1.src.rpm
d3e4ca4
This line would disable the python, tcl, and test subpackages, enable the
6e96691
regression test run during build, and disable kerberos support.
6e96691
6e96691
You might need to disable runselftest if there is an installed version of
6e96691
PostgreSQL that is a different major version from what you are trying to
6e96691
build.  The self test tends to pick up the installed libpq.so shared library
6e96691
in place of the one being built :-(, so if that isn't compatible the test will
6e96691
fail.  Also, you can't use runselftest when doing the build as root.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
More of these conditionals will be added in the future.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
CONTRIB FILES
cvsdist 6f2c3a9
-------------------------------------------------------------------------------
cvsdist 6f2c3a9
The contents of the contrib tree are packaged into the -contrib subpackage
cvsdist 06e8d17
and are processed with make and make install.  There is documentation in
cvsdist 06e8d17
/usr/share/doc/postgresql-contrib-VERSION for these modules.  Most of the
cvsdist 06e8d17
modules are in /usr/lib/pgsql for loadable modules, and binaries are in 
cvsdist 06e8d17
/usr/bin.  In the future these files may be split out, depending upon function
cvsdist 06e8d17
and dependencies.
cvsdist 6f2c3a9
cvsdist 6f2c3a9
MORE INFORMATION
cvsdist 6f2c3a9
-------------------------------------------------------------------------------
d3e4ca4
You can get more information at http://www.postgresql.org and 
d3e4ca4
http://pgfoundry.org/projects/pgsqlrpms
cvsdist 6f2c3a9
80b1cae
Please help make this packaging better -- let us know if you find problems, or
80b1cae
better ways of doing things.  You can reach us by e-mail at
d3e4ca4
pgsqlrpms-hackers@pgfoundry.org
cvsdist 6f2c3a9
80b1cae
SUSE products usually ship with the latest version of PostgreSQL that
80b1cae
was available at the time they were released. RPMs for newer versions
80b1cae
of PostgreSQL can be found on the SUSE FTP server and it's mirrors.
80b1cae
80b1cae
ftp://ftp.suse.com/pub/projects/postgresql
80b1cae
http://www.novell.com/products/linuxprofessional/downloads/ftp/int_mirrors.html
80b1cae
-------------------------------------------------------------------------------