User Tools

Site Tools


installing_postgresql_on_rh_fc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
installing_postgresql_on_rh_fc [2007/04/25 16:33] – Oops, fixed other link under Prev stephanninstalling_postgresql_on_rh_fc [2007/04/25 16:50] stephann
Line 1: Line 1:
 +===== Install PostgreSQL on RH/FC =====
 +<<[[installing_packages_on_rh_fc|Prev]]|[[server_installation|Index]]|[[installing_apache2_and_mod_perl2_on_rh_fc|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 [[http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/|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 [[https://projects.commandprompt.com/public/pgsql/browser/trunk/pgsql/contrib/tablefunc/|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 [[http://www.postgresql.org/docs/8.1/interactive/plpgsql.html|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 [[http://www.postgresql.org/docs/8.1/interactive/plperl-trusted.html|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
 +
 +<<[[installing_packages_on_rh_fc|Prev]]|[[server_installation|Index]]|[[installing_apache2_and_mod_perl2_on_rh_fc|Next]]>>
 +
 +This page is under construction.

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 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.