2004-09-09 10:37:06 +00:00
|
|
|
README.rpm-dist
|
|
|
|
-----------------------------------------------------------------------------
|
2009-08-18 02:58:55 +00:00
|
|
|
Version 8.4, for the PostgreSQL 8.4 RPM set.
|
|
|
|
Devrim Gündüz <devrim@CommandPrompt.com>
|
2004-09-09 10:41:12 +00:00
|
|
|
-----------------------------------------------------------------------------
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
Contents:
|
2005-01-19 05:02:11 +00:00
|
|
|
0.) Quick note about '-i'
|
2009-08-18 02:58:55 +00:00
|
|
|
1.) Introduction and QuickStart
|
2004-09-09 10:37:06 +00:00
|
|
|
2.) PostgreSQL RPM packages and rationale
|
2004-09-09 10:41:55 +00:00
|
|
|
3.) Starting multiple postmasters
|
2004-09-09 10:37:06 +00:00
|
|
|
4.) Regression Testing
|
|
|
|
5.) Starting postmaster automatically on startup
|
2005-01-19 05:02:11 +00:00
|
|
|
6.) Grand Unified Configuration(GUC) File
|
|
|
|
7.) Logging set up
|
|
|
|
8.) Rebuilding from the source RPM
|
|
|
|
9.) Contrib files
|
2004-09-09 10:37:06 +00:00
|
|
|
10.) Further Information Resource
|
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
QUICK NOTE ABOUT '-i'
|
2004-09-09 10:37:06 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
The postmaster '-i' option is NOT used by default in the initscript shipped
|
|
|
|
with these RPMs. Please do NOT modify the initscript to add the '-i' back
|
|
|
|
in -- it will get overwritten on the next package upgrade. Rather, see the
|
|
|
|
section below on the Grand Unified Configuration file, which includes the
|
2006-03-02 19:04:52 +00:00
|
|
|
recommended way to get '-i' functionality.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
INTRODUCTION
|
|
|
|
-----------------------------------------------------------------------------
|
2005-01-19 05:02:11 +00:00
|
|
|
This document exists to explain the layout of the RPMs for PostgreSQL, to
|
2004-09-09 10:41:55 +00:00
|
|
|
describe various RPM specifics, and to document special features found
|
|
|
|
in the RPMset.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2009-08-18 02:58:55 +00:00
|
|
|
This document is written to be applicable to version 8.4 of PostgreSQL,
|
2005-01-19 05:02:11 +00:00
|
|
|
which is the current version of the RPMs as of this writing. More to the
|
2009-08-18 02:58:55 +00:00
|
|
|
point, versions prior to 8.4 are not documented here.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2009-08-18 02:58:55 +00:00
|
|
|
Official PostgreSQL Global Development Group RPMs carry a 'PGDG after the
|
|
|
|
release number. Other RPMsets as distributed with Linux distributions may
|
|
|
|
have a different release number and initials.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2009-08-18 02:58:55 +00:00
|
|
|
If you want to stay up-to-date on the PostgreSQL core itself, you may
|
|
|
|
want to use PGDG set, instead of the binaries supplied by distribution.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2009-08-18 02:58:55 +00:00
|
|
|
These RPMs do not support any sort of major version upgrading process
|
|
|
|
other than that documented in the regular documentation. That is, you
|
|
|
|
must dump, upgrade,initdb, and restore your data if you are
|
|
|
|
performing a major version update. This is not needed for minor version
|
|
|
|
updates.
|
2004-09-09 10:41:55 +00:00
|
|
|
|
2009-08-18 02:58:55 +00:00
|
|
|
For major version upgrade, dump first, then remove the old server
|
|
|
|
subpackage, install the new package, and restore the data from dump.
|
|
|
|
|
|
|
|
This document is intended for use only with Red Hat, CentOS and Fedora.
|
2004-09-09 10:41:55 +00:00
|
|
|
|
2004-09-09 10:37:06 +00:00
|
|
|
QUICKSTART
|
|
|
|
-----------------------------------------------------------------------------
|
2009-08-18 02:58:55 +00:00
|
|
|
For a fresh installation, you will need to initialize the cluster first. Run:
|
|
|
|
|
|
|
|
service postgresql initdb
|
|
|
|
|
|
|
|
as root, and it will prepare a new database cluster for you. Then you will
|
|
|
|
need to start PostgreSQL. Again as root, run:
|
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
service postgresql start
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2009-08-18 02:58:55 +00:00
|
|
|
This command will start a postmaster that willl listen on localhost and Unix
|
|
|
|
socket 5432 only. Edit /var/lib/pgsql/data/postgresql.conf and pg_hba.conf
|
|
|
|
if you want to allow remote access -- see the section on Grand Unified
|
|
|
|
Configuration.
|
|
|
|
|
|
|
|
The file /var/lib/pgsql/.bash_profile is packaged to help with the
|
2004-09-09 10:37:06 +00:00
|
|
|
setting of environment variables. You may edit this file, and it won't be
|
2009-08-18 02:58:55 +00:00
|
|
|
overwritten during an upgrade. However, enhancements and bugfixes may
|
|
|
|
be added to this file, so be sure to check .bash_profile.rpmnew after
|
|
|
|
upgrading.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
The user 'postgres' is created during installation of the server subpackage.
|
|
|
|
This user by default is UID and GID 26. The user has the default shell set to
|
|
|
|
bash, and the home directory set to /var/lib/pgsql. This user also has no
|
2005-01-19 05:02:11 +00:00
|
|
|
default password -- in order to be able to su to it from a non-root account
|
2004-09-09 10:37:06 +00:00
|
|
|
or login as 'postgres' you will need to set a password using passwd.
|
|
|
|
|
|
|
|
POSTGRESQL RPM PACKAGES AND RATIONALE.
|
|
|
|
-----------------------------------------------------------------------------
|
2005-01-19 05:02:11 +00:00
|
|
|
PostgreSQL is split up into multiple packages so that users can 'pick and
|
|
|
|
choose' what pieces are needed, and what dependencies are required.
|
|
|
|
|
2004-09-09 10:41:55 +00:00
|
|
|
The RPMset is packaged in the following subpackages:
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
postgresql: Key clients and libraries, and documentation
|
|
|
|
postgresql-libs: Client shared libraries
|
2004-09-09 10:37:06 +00:00
|
|
|
postgresql-server: Server executables and data files
|
2005-01-19 05:02:11 +00:00
|
|
|
postgresql-devel: Development libraries and include files
|
2007-01-13 04:30:50 +00:00
|
|
|
postgresql-python: The PyGreSQL client library
|
2005-01-19 05:02:11 +00:00
|
|
|
postgresql-tcl: Tcl client library (Pgtcl)
|
|
|
|
postgresql-test: The regression tests and associated files
|
|
|
|
postgresql-docs: Extra documentation, such as the tutorial files
|
|
|
|
postgresql-contrib: The contrib source tree, as well as selected binaries
|
2007-01-13 04:30:50 +00:00
|
|
|
postgresql-plperl: PL/Perl procedural language
|
|
|
|
postgresql-plpython: PL/Python procedural language
|
|
|
|
postgresql-pltcl: PL/Tcl procedural language
|
2004-09-09 10:41:55 +00:00
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
You have to install postgresql and postgresql-libs to do anything.
|
|
|
|
postgresql-server is needed unless you only plan to use the clients to work
|
|
|
|
with a remote PostgreSQL server. The others are optional.
|
|
|
|
|
2007-01-13 04:30:50 +00:00
|
|
|
Note that there is no postgresql-perl, postgresql-jdbc, postgresql-odbc, or
|
|
|
|
postgresql-tk package any longer. This is due to these portions being split
|
|
|
|
into separate source distributions.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2007-01-13 04:30:50 +00:00
|
|
|
While PyGreSQL was split out from the core PostgreSQL distribution, thanks to
|
2005-01-19 05:02:11 +00:00
|
|
|
Kaj's work it is still included as the python subpackage. Also, Pgtcl is
|
|
|
|
still included as the tcl subpackage, although it is not part of the core
|
|
|
|
distribution anymore.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
RPM FILE LOCATIONS.
|
|
|
|
-----------------------------------------------------------------------------
|
2005-01-19 05:02:11 +00:00
|
|
|
To be in compliance with the Linux FHS, the PostgreSQL RPMs install files in
|
|
|
|
a manner not consistent with most of the PostgreSQL documentation. According
|
|
|
|
to the standard PostgreSQL documentation, PostgreSQL is installed under the
|
|
|
|
directory /usr/local/pgsql, with executables, source, and data existing in
|
|
|
|
various subdirectories.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
Different distributions have different ideas of some of these file locations.
|
|
|
|
In particular, the documentation directory can be /usr/doc, /usr/doc/packages,
|
2009-08-18 02:58:55 +00:00
|
|
|
/usr/share/doc, /usr/share/doc/packages, or some other similar path.
|
|
|
|
|
|
|
|
However, the Red Hat / CentOS / Fedora RPM's install the files like
|
|
|
|
this:
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
Executables: /usr/bin
|
2009-08-18 02:58:55 +00:00
|
|
|
Libraries: /usr/lib (or /usr/lib64)
|
|
|
|
Documentation: /usr/share/doc/postgresql-docs-x.y.z/html
|
2005-01-19 05:02:11 +00:00
|
|
|
Contrib documentation: /usr/share/doc/postgresql-contrib-x.y.z
|
2004-09-09 10:37:06 +00:00
|
|
|
Source: not installed
|
|
|
|
Data: /var/lib/pgsql/data
|
2009-08-18 02:58:55 +00:00
|
|
|
Backup area: /var/lib/pgsql/backups
|
2004-09-09 10:37:06 +00:00
|
|
|
Templates: /usr/share/pgsql
|
2009-08-18 02:58:55 +00:00
|
|
|
Procedural Languages: /usr/lib/pgsql or /usr/lib64/pgsql
|
2004-09-09 10:37:06 +00:00
|
|
|
Development Headers: /usr/include/pgsql
|
|
|
|
Other shared data: /usr/share/pgsql
|
|
|
|
Regression tests: /usr/lib/pgsql/test/regress (in the -test package)
|
2009-08-18 02:58:55 +00:00
|
|
|
or /usr/lib64/pgsql/test/regress
|
|
|
|
Documentation SGML: /usr/share/doc/postgresql-docs-x.y.z/sgml
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
While it may seem gratuitous to place these files in different locations, the
|
|
|
|
FHS requires it -- distributions should not ever touch /usr/local. It may
|
|
|
|
also seem like more work to keep track of where everything is -- but, that's
|
|
|
|
the beauty of RPM -- you don't have to keep track of the files, RPM does it
|
|
|
|
for you.
|
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
These RPMs are designed to be LSB-compliant -- if you find this not to be the
|
2007-01-13 04:30:50 +00:00
|
|
|
case, please let us know by way of the pgsqlrpms-hackers@pgfoundry.org
|
2005-11-07 21:54:56 +00:00
|
|
|
mailing list.
|
2004-09-09 10:39:06 +00:00
|
|
|
|
2004-09-09 10:41:55 +00:00
|
|
|
MULTIPLE POSTMASTERS
|
2004-09-09 10:37:06 +00:00
|
|
|
-------------------------------------------------------------------------------
|
2004-09-09 10:41:55 +00:00
|
|
|
The postgresql-server RPM contains an 'initscript' that is used to start the
|
|
|
|
postmaster. The current version of this script has logic to be able to start
|
|
|
|
multiple postmasters, with different data areas, listening on different ports,
|
|
|
|
etc. To use this functionality requires root access.
|
|
|
|
|
|
|
|
As an example, let us create a secondary postmaster called, creatively enough,
|
|
|
|
'secondary'. Here are the steps:
|
|
|
|
1.) create a hard link in /etc/rc.d/init.d (or equivalent location)
|
|
|
|
to postgresql named 'secondary' : ln postgresql secondary Pick
|
|
|
|
a name not already used in /etc/rc.d/init.d!
|
|
|
|
2.) create a file in /etc/sysconfig/pgsql named secondary. This file is
|
|
|
|
a shell script -- typically you would define PGDATA, PGPORT, and PGOPTS
|
|
|
|
here. Since $PGDATA/postgresql.conf will override many of these
|
|
|
|
settings, except PGDATA, you might be surprised on startup.
|
|
|
|
3.) create the target PGDATA.
|
|
|
|
4.) Initdb the targe PGDATA as documented in the main documentation.
|
|
|
|
Automatic initdb may or may not work for you, so a manual one is
|
|
|
|
preferred. This must be done as user 'postgres'
|
|
|
|
5.) Edit postgresql.conf to change the port, address, tcpip settings, etc.
|
|
|
|
6.) Start the postmaster with 'service secondary start'.
|
|
|
|
|
|
|
|
Note that there may be problems with the standard symlink -- consider this
|
|
|
|
support experimental at this point in time.
|
2004-09-09 10:41:12 +00:00
|
|
|
|
2004-09-09 10:37:06 +00:00
|
|
|
REGRESSION TESTING
|
|
|
|
-------------------------------------------------------------------------------
|
2005-01-19 05:02:11 +00:00
|
|
|
If you install the postgresql-test RPM then you can run the PostgreSQL
|
2004-09-09 10:37:06 +00:00
|
|
|
regression tests. These tests stress your database installation and produce
|
|
|
|
results that give you assurances that the installation is complete, and that
|
|
|
|
your database machine is up to the task.
|
|
|
|
|
|
|
|
To run the regression tests under the RPM installation, make sure that
|
|
|
|
postmaster has been started (if not, su to root and execute the
|
2005-01-19 05:02:11 +00:00
|
|
|
"/etc/rc.d/init.d/postgresql start" init script), cd to
|
2009-08-18 02:58:55 +00:00
|
|
|
/usr/lib/pgsql/test/regress (or /usr/lib64/pgsql/test/regress),
|
|
|
|
su to postgres, and execute "make check".
|
2005-01-19 05:02:11 +00:00
|
|
|
This command will start the regression tests and will both show the
|
2004-09-09 10:37:06 +00:00
|
|
|
results to the screen and store the results in the file regress.out.
|
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
If any tests fail, see the file regression.diffs in that directory for details,
|
|
|
|
and read the "Regression Tests" section of the PostgreSQL documentation to
|
|
|
|
find out whether the differences are actually significant. If you need help
|
2009-08-18 02:58:55 +00:00
|
|
|
interpreting the results, contact the pgsql-general list at
|
|
|
|
postgresql.org.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
After testing, say "make clean" to remove the files generated by the test
|
|
|
|
script.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
STARTING POSTMASTER AUTOMATICALLY AT SYSTEM STARTUP
|
|
|
|
-------------------------------------------------------------------------------
|
2009-08-18 02:58:55 +00:00
|
|
|
Fedora / Red Hat / CentOS use the System V Init package. A startup
|
|
|
|
script for PostgreSQL is provided in the server package, as
|
|
|
|
/etc/rc.d/init.d/postgresql. To start the postmaster, with sanity
|
|
|
|
checking, as root, run
|
2005-01-19 05:02:11 +00:00
|
|
|
service postgresql start
|
|
|
|
To shut the postmaster down,
|
|
|
|
service postgresql stop
|
|
|
|
There are other possible commands to this script -- execute
|
|
|
|
'service postgresql' for a listing.
|
|
|
|
|
|
|
|
To get this script to run at system startup or any time the system switches
|
|
|
|
into runlevels 3, 4, or 5, run:
|
|
|
|
chkconfig --add postgresql
|
|
|
|
chkconfig --level 345 postgresql on
|
|
|
|
and the proper symlinks will be created. See the chkconfig man page for more
|
2004-09-09 10:39:06 +00:00
|
|
|
information. Note that this is manual -- while the startup script can include
|
|
|
|
tags to allow chkconfig to automatically perform the symlinking, this is not
|
|
|
|
done at this time.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
GRAND UNIFIED CONFIGURATION (GUC) FILE
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
The PostgreSQL server has many tunable parameters -- the file
|
|
|
|
/var/lib/pgsql/data/postgresql.conf is the master configuration file for the
|
|
|
|
whole system.
|
|
|
|
|
|
|
|
The RPM ships with the default file -- you will need to tune the
|
|
|
|
parameters for your installation. In particular, you might want to allow
|
2005-01-19 05:02:11 +00:00
|
|
|
nonlocal TCP/IP socket connections -- in order to allow these, you will need
|
|
|
|
to edit the postgresql.conf file. The line in question contains the string
|
|
|
|
'listen_addresses' -- you need to both uncomment the line and set the value
|
|
|
|
to '*' to get the postmaster to accept nonlocal connections. You'll also need
|
|
|
|
to adjust pg_hba.conf appropriately.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2005-01-19 05:02:11 +00:00
|
|
|
LOGGING SET UP
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
By default, the postmaster's stderr log is directed into files placed in a
|
|
|
|
pg_log subdirectory of the data directory (ie, /var/lib/pgsql/data/pg_log).
|
|
|
|
The out-of-the-box configuration rotates among seven files, one for each
|
|
|
|
day of the week. You can adjust this by changing postgresql.conf settings.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
REBUILDING FROM SOURCE RPM
|
|
|
|
-------------------------------------------------------------------------------
|
2005-01-19 05:02:11 +00:00
|
|
|
If your distribution is not supported by the binary RPMs from PostgreSQL.org,
|
2004-09-09 10:37:06 +00:00
|
|
|
you will need to rebuild from the source RPM. Download the .src.rpm for this
|
2009-08-18 02:58:55 +00:00
|
|
|
release. You will need to be root to rebuild, unless you have set up
|
|
|
|
a non-root build environment (which is the recommended method anyway).
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2009-08-18 02:58:55 +00:00
|
|
|
Install the source RPM with rpm -i, then cd to the rpm building area
|
|
|
|
(which is /usr/src/redhat by default). You will have to have a full
|
|
|
|
development environment to rebuild the full RPM set.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
This release of the RPMset includes the ability to conditionally build
|
|
|
|
sets of packages. The parameters, their defaults, and the meanings are:
|
|
|
|
|
2004-09-09 10:39:06 +00:00
|
|
|
beta 0 #build with cassert and do not strip the binaries
|
2007-01-13 04:30:50 +00:00
|
|
|
python 1 #build the postgresql-python package.
|
2004-09-09 10:37:06 +00:00
|
|
|
tcl 1 #build the postgresql-tcl package.
|
|
|
|
test 1 #build the postgresql-test package.
|
2009-08-18 02:58:55 +00:00
|
|
|
plpython 1 #build the PL/Python procedural language package.
|
|
|
|
pltcl 1 #build the PL/Tcl procedural language package.
|
|
|
|
plperl 1 #build the PL/Perl procedural language package.
|
2004-09-09 10:37:06 +00:00
|
|
|
ssl 1 #use OpenSSL support.
|
|
|
|
kerberos 1 #use Kerberos 5 support.
|
2004-09-09 10:39:06 +00:00
|
|
|
nls 1 #build with national language support.
|
2009-08-18 02:58:55 +00:00
|
|
|
ldap 1 #build with LDAP support.
|
2004-09-09 10:41:55 +00:00
|
|
|
pam 1 #build with PAM support.
|
2005-01-19 05:02:11 +00:00
|
|
|
runselftest 1 #do "make check" during the build.
|
2009-08-18 02:58:55 +00:00
|
|
|
sdt 1 #build with SystemTap support.
|
|
|
|
xml 1 #build with XML support
|
2006-03-02 19:04:52 +00:00
|
|
|
pgfts 1 #build with --enable-thread-safety
|
2009-08-18 02:58:55 +00:00
|
|
|
uuid 1 #build contrib/uuid-ossp
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
To use these defines, invoke a rebuild like this:
|
2006-03-02 19:04:52 +00:00
|
|
|
rpmbuild --rebuild --define 'python 0' --define 'tcl 0' \
|
2009-08-18 02:58:55 +00:00
|
|
|
--define 'test 0' --define 'runselftest 0' --define 'kerberos 0' \
|
|
|
|
postgresql-8.4.0-1.src.rpm
|
|
|
|
This line would disable the python, tcl, and test subpackages, disable the
|
2005-01-19 05:02:11 +00:00
|
|
|
regression test run during build, and disable kerberos support.
|
|
|
|
|
|
|
|
You might need to disable runselftest if there is an installed version of
|
|
|
|
PostgreSQL that is a different major version from what you are trying to
|
|
|
|
build. The self test tends to pick up the installed libpq.so shared library
|
|
|
|
in place of the one being built :-(, so if that isn't compatible the test will
|
|
|
|
fail. Also, you can't use runselftest when doing the build as root.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
More of these conditionals will be added in the future.
|
|
|
|
|
|
|
|
CONTRIB FILES
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
The contents of the contrib tree are packaged into the -contrib subpackage
|
2004-09-09 10:41:55 +00:00
|
|
|
and are processed with make and make install. There is documentation in
|
|
|
|
/usr/share/doc/postgresql-contrib-VERSION for these modules. Most of the
|
2009-08-18 02:58:55 +00:00
|
|
|
modules are in /usr/lib/pgsql (or /usr/lib64/pgsql) for loadable
|
|
|
|
modules, and binaries are in /usr/bin. In the future these files may be
|
|
|
|
split out, depending upon function and dependencies.
|
2004-09-09 10:37:06 +00:00
|
|
|
|
|
|
|
MORE INFORMATION
|
|
|
|
-------------------------------------------------------------------------------
|
2006-03-02 19:04:52 +00:00
|
|
|
You can get more information at http://www.postgresql.org and
|
2009-08-18 02:58:55 +00:00
|
|
|
http://yum.pgsqlrpms.org
|
2004-09-09 10:37:06 +00:00
|
|
|
|
2005-11-07 21:54:56 +00:00
|
|
|
Please help make this packaging better -- let us know if you find problems, or
|
2009-08-18 02:58:55 +00:00
|
|
|
better ways of doing things. You can reach us by e-mail at
|
2006-03-02 19:04:52 +00:00
|
|
|
pgsqlrpms-hackers@pgfoundry.org
|
2005-11-07 21:54:56 +00:00
|
|
|
-------------------------------------------------------------------------------
|