This is an old revision of the document!
Table of Contents
Installing Postgresql on Debian
Install Base Packages
To install the postgresql packages on debian.
apt-get install postgresql-8.1 postgresql-contrib-8.1 postgresql-doc-8.1 postgresql-plperl-8.1 postgresql-server-dev-8.1
Explanation:
- postgresql-8.1 - This is the core package that contains the program.
- postgresql-contrib-8.1 - The contains contributed utilites and stored procedures.
- postgresql-doc-8.1 - The documentation.
- postgresql-plperl-8.1 - Perl procedural language.
- postgresql-server-dev-8.1 - Dev files.
—-
Installing Contrib packages
Switch to user postgres for any of the following commands
# su postgres
Tsearch2 - full text search extension for PostgreSQL.
bash# psql template1 < /usr/share/postgresql/8.1/contrib/tsearch2.sql
tablefunc - Crosstab (aka, pivot) functions, CONNECT_BY (tree descendancy) function.
bash# psql template1 < /usr/share/postgresql/8.1/contrib/tablefunc.sql
Create Database and add languages
Add the plpgsql language to template1. This allows any database created after this to use the plpgsql language. This language is considered safe and does not give any more access than regular SQL commands.
bash# createlang plpgsql -d template1
Create the database evegreen.
bash# createdb -E UNICODE evergreen
Add plperl and plperlu languages to evergreen. The plperlu language provides an environment for executing any Perl code so it isn't considered safe.
bash# createlang plperl -d evergreen bash# 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# dropdb evergreen bash# createdb -E UNICODE evergreen bash# createlang plperl -d evergreen bash# createlang plperlu -d evergreen