User Tools

Site Tools


installing_postgresql_on_rh_fc

This is an old revision of the document!


Install PostgreSQL on RH/FC

<<Prev|Index|Next>>

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

Change db user password

 bash-3.1$ psql

Here you will see a welcome message.

 postgres=# alter user postgres password 'my password';

PostgreSQL will respond with "ALTER ROLE".

 postgres=# \q

<<Prev|Index|Next>>

This page is under construction.

installing_postgresql_on_rh_fc.1283793762.txt.gz · Last modified: 2022/02/10 13:33 (external edit)

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.