Friday, March 7, 2008

PostgreSQL configuration



Login to the operating system as a User who has rights to create a database. If you haven't set this up yet, as user postgresql, run the createuser command and give the new User privileges to create databases.

Create the database:

createdb -E UNICODE calendar



  1. Load the database schema:

    psql calendar <>
  2. You will need to edit the postgresql.conf file. On RedHat Linux, this file is in the /var/lib/pgsql/data directory. On FreeBSD, this file is in /usr/local/pgsql/data. Change the line:

    #tcpip_socket=false

    to read

    tcpip_socket=true
  3. Restart the PostgreSQL Service.
  4. Copy the JDBC Driver files to your application server's path, or the WEB-INF/lib directory.
  5. Edit the pg_hba.conf file if necessary. To test if this is necessary, run the command:

    psql -h calendar

    If the connection is refused, you will need to add the appropriate permissions entries to PG_HBA.CONF. It may also be necessary to edit the startup script for postmaster to ensure that it is listening on TCP/IP sockets. Refer to the man page for postmaster for more information on startup options.
  6. Edit the configuration.properties file, putting in the configuration entries for your database.

DBObjectClass=com.MHSoftware.db.support.PostgreSQLDB
JDBCConnectString=jdbc\:postgresql\://localhost\:5432/calendar
JDBCUserID=calendar
JDBCPassword=calendar
JDBCDriver=org.postgresql.Driver

No comments: