This is an old revision of the document!
Table of Contents
Install PostgreSQL on RH/FC
Some of these notes come from the mailing list at http://open-ils.org/listserv.html.
PostgreSQL Packages
These are the packages you will need to install for PostgreSQL on Red Hat or Fedora Core.
postgresql postgresql-contrib (contributed utilities and stored procedures) postgresql-devel postgresql-docs postgresql-libs (installs as a dependency with posgresql) postgresql-pl postgresql-server (installs as a dependency with postgresql-pl)
The current version of PostgreSQL appears to be 8.1.8.
Configuring PostgreSQL
You will need to start the PostgreSQL server manually the first time. Eventually, you may want to configure it to run at system startup.
service postgresql start
Switch to user postgres before running the commands below.
su postgres
Contrib utilities
The tsearch2 utility is a full-text search extension for PostgreSQL. You should add this to template1 (which will subsequently be used to create your database).
bash-3.1$ psql template1 < /usr/share/pgsql/contrib/tsearch2.sql
You will also want to add tablefunc to template1. This installs crosstab (pivot) and connectby (tree descendancy) functions.
bash-3.1$ psql template1 < /usr/share/pgsql/contrib/tablefunc.sql
Create database and add languages
Change to the postgres user home directory and add the plpgsql language to template1. This allows any database created hereafter to use this language. It is considered safe and does not give any more access than regular SQL commands.
bash-3.1$ createlang plpgsql -d template1
Create a Unicode database named evergreen.
bash-3.1$ createdb -E UNICODE evergreen
Add plperl and plperlu languages to the evergreen database only. The plperlu language provides an environment for executing any Perl code so it isn't considered safe to add to template1.
bash-3.1$ createlang plperl -d evergreen bash-3.1$ createlang plperlu -d evergreen
Drop and recreate database
If you need to start over with a fresh database these commands will drop the current evergreen and recreate it.
bash-3.1$ dropdb evergreen bash-3.1$ createdb -E UNICODE evergreen bash-3.1$ createlang plperl -d evergreen bash-3.1$ createlang plperlu -d evergreen