Note that steps 1 through 3 of the following instructions are aimed at users who don't already master PostgreSQL administration. Experimented users may choose different options (such as creating a schema instead of a new database, etc.) as long as in the end, the database objects are accessible by the client programs.
1) On the machine that hosts the database server, create a user
that will own the database objects:
In this example, no password is requested. If you plan to use
passwords, add the -P option (a password may be necessary depending on
the authentication settings in the server's pg_hba.conf file. See
that file and PostgreSQL manual for details).
postgres:~$ createuser mailadmin Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) y CREATE USER
2) create a new database for storing mail messages. Unicode encoding is preferred.
postgres:~$ createdb -E UTF8 -O mailadmin mail CREATE DATABASE
3) Create the pl/sql language for the new database
postgres:~$ createlang plpgsql -d mail
4) Connect as that user and create manitou database objects.
(If the connection to the database fails at this point,
please check your postgres configuration file as described in the
PostgreSQL manual).
The SQL scripts are located in $prefix/share/manitou/sql
where $prefix is the root of the installation tree that defaults
to /usr/local.
postgres:~$ cd /usr/local/share/manitou/sql
postgres:~$ psql -U mailadmin -d mail
Welcome to psql 7.4.2, 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
mail=> \i crpg.sql
(approximatively one page of output, check out for any errors. "Notice" messages
can be safely ignored)
mail=> \q
postgres:~$
Once this is done, the database is ready to store mail.