Dashboard > DHIS Documentation > ... > Tools > PostgreSQL
  DHIS Documentation Log In | Sign Up   View a printable version of the current page.  
  PostgreSQL
Added by margrsto, last edited by Anders Gjendem on Jan 14, 2007  (view change)
Labels: 
(None)

DHIS 2 PostgreSQL database instructions

Quick guide:
Download latest version. PostgreSQL documentation.

Download:

Download PostgreSQL from http://www.postgresql.org/download/.

Install:

Windows:

  • Start the installation by clicking the installer in your downloaded version
  • Follow the instructions by the program
  • Name your user dhis when asked

Mac:

Binary packages and instructions can be found at http://www.entropy.ch/software/macosx/postgresql/
Take a look at How to run the PostgreSQL server
If you wish to compile it yourself a guide can be found here
http://developer.apple.com/internet/opensource/postgres.html

Setup/Configuration:

How to run the PostgreSQL server

Windows:

Mac:

Install the StartupItem package from http://www.entropy.ch/software/macosx/postgresql/

Optional setup to make life easier:

Prepare PostgreSQL for DHIS 2

  1. Go to the start menu -> programs -> PostgreSQL 8.1 and click on pgAdmin III. pgAdmin is a nice and intuitive graphical administration tool for PostgreSQL. Documentation for pgAdmin can be found here: http://www.pgadmin.org/docs/1.4/using.html
  2. In pgAdmin connect to your database server, by default named PostgreSQL Database Server 8.1. You will be asked for a password which is the one you entered for the user at the installation of PostgreSQL.
  3. Right-click on databases -> New database. Name your database dhis2, and the owner of the database dhis. Now your PostgreSQL-settings should match your hibernate.properties file.
  4. Go to start menu -> programs -> PostgreSQL 8.1 and click on Start service. If you now run the application the database shell will be created for you. You must always remember to use Start service before you want to use your DHIS 2 with your PostgreSQL-database.

hibernate.properties

Create a file called "hibernate.properties" in USER_HOME/dhis/.

Content of "hibernate.properties":

hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql:dhis2
hibernate.connection.username = dhis
hibernate.connection.password = 
hibernate.hbm2ddl.auto = update

Additional tools:

PgAdmin III

Graphical user interface to PostgreSQL database servers. Exists for all major operating systems.

Mac:

At the time of writing the newest version is 1.6.2 and can be found at http://www.postgresql.org/ftp/pgadmin3/release/v1.6.2/osx/

Documentation:

http://www.postgresql.org/docs/

Documentation for pgAdmin can be found here: http://www.pgadmin.org/docs/1.4/using.html

PostgreSQL in DHIS 2 (DHIS Documentation)

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators