How to connect to PostgreSQL to retrieve data

You may encounter a situation where you need to access data that reside on a PostgreSQL data system and you want to analyze it using Epi Info 7 for the desktop.  Once you connect to the PostgreSQL server, you will choose a table or view and have access to that particular data table.  If you add or change variables while in Epi Info, those changes will not affect the data on the PostgreSQL server.  Additionally, at this time, you cannot upload data to a PostgreSQL server.

NOTE: the example below uses a DVDRental database that is available here.  The information you enter in Step 5 and the resulting tables/views you see will not be the same unless you have this sample data residing on the PostgreSQL data server and have it hosted locally (i.e., on your machine).

Step-by-step guide

Connecting to the PostgreSQL server:

  1. Open Epi Info desktop.

  2. Choose ‘Classic.'  You could also choose 'Visual Dashboard.'  If you choose the latter, go to Step 4.


  3. In the Command Explorer, under ‘Data,’ choose “Read.”


  4. Within the Read dialogue, Select “PostgreSQL Database” as you ‘Database Type.’
  5. Choose the ‘Browse’ button from the ‘Data Source’ box.  This will open a dialogue box.
    1. Server Name:  If PostgreSQL is on your machine (local), you can use “localhost” or “128.0.0.1”.  If PostgreSQL is on a network, you will have to get the IP address from your network administrator or the database administrator (DBA).
    2. Port:  The default for PostgreSQL is 5432.  If PostgreSQL is on the network, try ‘5432;’ if that doesn’t work, check with your network admin or DBA.
    3. Database Name:  An RDBMS like PostgreSQL will typically have several “Databases” residing under them.  This kind of system is not like Microsoft Access.  It is an alternative to Microsoft SQL Server, MySQL, or Oracle.   Unless you set up PostgreSQL locally, you may have to ask your DBA which database name has your data.
    4. Username:  The name that you log on to this particular database with.  Several people may access the database with the same user name.  This may be different than the username you log on to Windows with.  You may have access to many different projects . . . all with different username/password combinations.  Check with your DBA if you are unable to login.  You may not have rights to the data you're trying to get to.
    5. Password:  The password that you use to log into this particular database with.
  6. If your credentials are correct, you should see a list of table / view names in the ‘Data Source Explorer.”  When you select one of these, that table (or view) will be the source of your data analysis from that point forward.




Filter by label

There are no items with the selected labels at this time.