Difference between revisions of "PostgreSQL on Debian"

From AOLserver Wiki
Jump to navigation Jump to search
Line 39: Line 39:
 
</pre>
 
</pre>
  
* [http://dev.panopticsearch.com/postgres_microhowto.html] 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).
+
* [http://dev.panopticsearch.com/postgres_microhowto.html] 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):
 +
<pre>
 +
    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
 +
 
 +
    template1=#
 +
 
 +
# Set a password for the database-user postgres (while being logged into the database (e.g. template1)).
 +
 
 +
    template1=# ALTER USER postgres WITH PASSWORD 'topsecret';
 +
    ALTER USER
 +
    template1=#
 +
 
 +
# Log out of the database (\q):
 +
 
 +
    template1=# \q
 +
    postgres @ box $
 +
</pre>
  
 
'''Related'''
 
'''Related'''

Revision as of 22:38, 6 December 2005

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:

/etc/postgresql/

Recommended

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

    template1=#

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

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

# Log out of the database (\q):

    template1=# \q
    postgres @ box $

Related