Database Setup

This section describes how to setup a database for an emarket installation.

PostgreSQL database setup

eMarket uses postgreSQL as the database. sections below describe how to install postgreSQL in Linux/UNIX and Windows operating systems.

PostgreSQL Installation in Linux, UNIX, Mac OS X

  1. Download "postgresql-x.x.x.tar.bz2" source tar ball from http://www.postgresql.org/ftp/source/
  2. Untar this file in the location of your choice.
  3. Follow the instructions below to compile and install the database.
    (Refer to INSTALL file for detailed instructions.)
    ./configure
    gmake
    su
    gmake install
    adduser postgres
    mkdir /emarket/data/pgsql/
    chown postgres /emarket/data/pgsql/
    su - postgres
    /usr/local/pgsql/bin/initdb -D /emarket/data/pgsql/emarketdb
    
    export PGDATA=/emarket/data/pgsql/emarketdb
    export PGPORT=5432
    export PGOPTS="-i"
    /usr/local/pgsql/bin/pg_ctl -l logs/logfile start -o "-h localhost -S -d 5"
    
    /usr/local/pgsql/bin/createdb emarketdb
    /usr/local/pgsql/bin/createuser -s emarket
    /usr/local/pgsql/bin/psql emarketdb

PostgreSQL Installation in Windows

  1. download "postgresql-x.x.x.zip" from http://www.postgresql.org/ftp/binary/
  2. unzip and install postgresql server.
  3. start server. click start - programs - postgresql - start service.
  4. start pgadmin. click start - programs - postgres - pgadmin.
    ( standard admin password is "potsgres" )
  5. right click on "login roles" and select "new login role".
    create login "emarket", select "super user", "can create database users", "can create roles".
  6. right click on databases and selct 'new database'.
    create database "emarketdb" and keep "emarket" as the owner of the database.

Create tables

cd emarket/platform-ng/src/main/resources
psql -d emarketdb -U emarket -f create_tables_pgsql.sql

Start database

  1. check database is up and running.
    Linux, UNIX, Mac OS X : psql -d emarketdb -U emarket
    Windows : pgadmin
  2. start the database if not running.

    Windows :
    start server. click start - programs - postgresql - start service.

    Linux, UNIX, Mac OS X :

    cd /emarket/data/pgsql
    export PGDATA=/emarket/data/pgsql/emarketdb
    export PGPORT=5432
    export PGOPTS="-i"
    pg_ctl -l logs/logfile start -o "-h localhost -S -d 5"