Basic Setup

The PostgreSQL database can be prepared in many ways. Below are presented two possible ways. The following assumptions apply to both methods:

  • admin_db_user - database user with admin rights
  • tigase_user - database user for Tigase
  • tigasedb - database for Tigase
Configuring from PostgreSQL Command Line Tool

Run the PostgreSQL command line client and enter following instructions:

  1. Add the tigase_user:

    psql=# create role tigase_user with login password 'tigase123';
  2. Create the database for the Tigase server with tigase_user as owner of database:

    psql=# create database tigasedb owner tigase_user;
  3. Load database schema to initialize the Tigase server from the file that corresponds to the version of Tigase you want to use. First you need to switch to tigasedb.

    psql=# \connect tigasedb

    Begin by applying the basic Schema

    psql=# \i database/postgresql-schema-7-1.sql

    Continue by adding the PubSub Schema

    psql=# \i database/postgresql-pubsub-schema-3.2.0.sql

    And finally if you wish to use Socks5 Proxy component, add that schema:

psql=# \i database/postgresql-socks5-schema.sql
Configuring From the Linux Shell Command Line

Follow steps below to prepare the PostgreSQL database:

  1. Add the tigase_user:

    createuser -U admin_db_user -W -D -R -S -P tigase_user

    You will be asked for credentials for admin_db_user and password for new database user.

  2. Create the database for the Tigase server with tigase_user as owner of database:

    createdb -U admin_db_user -W -O tigase_user tigasedb
  3. Load database schema to initialize the Tigase server from the file that corresponds to the Tigase version you want to use.

    psql -q -U tigase_user -W tigasedb -f database/postgresql-schema-7-1.sql
    psql -q -U tigase_user -W tigasedb -f database/postgresql-pubsub-schema-3.2.0.sql

    If you want to use the socks5 proxy component, then add the following line:

    psql -q -U tigase_user -W tigasedb -f database/postgresql-socks5-schema.sql

    The above commands should be executed from the main Tigase directory. The initialization schema file should be also available locally in database/ directory of your Tigase installation.