PostgreSQL database use

Submitted by kobit on Tue, 2010-04-06 21:16
::
This guide describes how to configure Tigase server to use PostgreSQL database as user repository. If you used XML based user repository before you can copy all user data to PostgreSQL database using repository management tool. All steps are described below.

PostgreSQL database preparation

Create new database user account which will be used to connect to your database:
# createuser
Enter name of user to add: tigase
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
Now using new database user account create database for your service:
# createdb -U tigase tigasedb
CREATE DATABASE
Now you can load database schema:
# psql -U tigase -d tigasedb -f postgresql-schema.sql
Now database is ready for Tigase server to use it.

Server configuration.

Server configuration is identical as for MySQL database setup. The same jdbc module is used to connect to PostgreSQL database as for MySQL. The only difference is connection string which usually looks like:
jdbc:postgresql://localhost/tigasdb?user=tigase
So for more detailed guide how to change configuration refer to MySQL database use guide or if you look for more automatic config file generation refer to configuration wizards page.