Installing PostgreSQL

This topic explains how to install the PostgreSQL database and create the database and tables required for the Bookstore tutorial.

Procedure

  1. Download and install PostgreSQL from http://www.postgresql.org/download/

    Note the superuser password that you create as part of the installation process.

    Note: If installing on Windows, do not install or run as Administrator.
  2. Open a terminal window and navigate to the root folder of the PostgreSQL installation. Open pg-env.bat and verify the path settings. Save the file if you make changes.
  3. Start the server. Navigate to the bin folder of the install directory and type: pg-ctrl start
    Enter the password you created for the superuser.
  4. Open another terminal window and navigate to the BW_HOME\samples\binding\rest\BookStore\scripts folder. Open readme.txt. On Unix systems, use the first command in the readme to start the script from the psql window. On Windows, copy the second command to start the script from the command line.
  5. Navigate to the PostgreSQL bin folder and paste the command line into the terminal window. Modify the command as needed. For Windows, use forward slashes in the command.
    Run the command to create the database, the database tables, and to populate the database.
  6. Open the PostgreSQL pgAdmin UI utility to see the database and tables.