Connecting to the PostgreSQL database

You can connect to the PostgreSQL database directly by using psql, an interactive terminal program. After you make the connection, you can use SQL statements to extract or query the data without using a business intelligence tool.
To verify that the PostgreSQL database is running, try to connect to it. If you get the psql command prompt, the database is running.
To connect to the PostgreSQL database:
  1. Log in to the primary computer.
  2. Go to this directory:
    • /aiw/aiw1/bin/postgresql/Linux/pgsql/bin (Linux)
    • C:\aiw\aiw1\bin\postgresql\Windows\pgsql\bin (Windows)
  3. Enter this command: ./psql database username

    Replace database with the name of the database that you specified in the Reports.json file, for example, history.

    Replace username with the user name that you specified in the Reports.json file, for example, rpdreports.

  4. If prompted, enter the password that you specified in the Reports.json file.

    The psql command prompt database=# is displayed.

    If you specified history in the Reports.json file, the command prompt is history=#.

    You now are connected to the PostgreSQL database.

  5. To access the data, run SQL statements.
  6. To exit psql, enter: \q
Copyright © 2018