PostgreSQL on Debian

From AOLserver Wiki
Revision as of 17:46, 12 December 2005 by Caveman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

While not always a part of an AOLserver installation, the fact that AOLserver is known almost foremost for its ability to support massively concurrent accesses to its database pools imply that it would be helpful to have such a database installed.

Some quick and easy steps to getting Postgresql up and running on Debian 3.1:

# install postgresql
apt-get install postgresql

# optional: to get some potentially useful documentation, should you choose to read it
apt-get install postgresql-doc

# optional: if you think you might be up for some postgresql hacking sometime
apt-get install postgresql-dev

# optional: useful contributed software includes some cryptographic hash functions
apt-get install postgresql-contrib

After installing the package(s) you want:

/etc/init.d/postgresql start

And you are running Postgresql. Congratulations. To make changes to your configuration files, visit:



While everyone has their own preferences for how to administer and customize their database installation, there are at least a couple of post-install steps that come in very handy:

  • [1] details importing the useful pgcrypto functions from postgresql-contrib into your template database:
root @ box # su postgres
postgres @ box $ psql template1 < /usr/share/postgresql/contrib/pgcrypto.sql
  • [2] details setting a database password for the postgres user, and setting up socket connection permissions (which allows, among other things, AOLserver to connect to the database):
    postgres @ box $ psql template1
    Welcome to psql, the PostgreSQL interactive terminal.

    Type:  \copyright for distribution terms
           \h for help with SQL commands
           \? for help on internal slash commands
           \g or terminate with semicolon to execute query
           \q to quit


# Set a password for the database-user postgres (while being logged into the database (e.g. template1)).

    template1=# ALTER USER postgres WITH PASSWORD 'topsecret';

# Log out of the database (\q):

    template1=# \q
    postgres @ box $

See also