Prepare the runtime environment - connecting to the database

  1. In order to connect to PostgreSQL, you must have a PostgreSQL database driver "dbmpgs*" in FGLDIR/dbdrivers. On HP/UX LP64, the PostgreSQL database driver must be linked with the libxnet library if you want to use networking.
  2. The PostgreSQL client software is required to connect to a database server. Check whether the PostgreSQL client library (libpq.*) is installed on the machine where the 4gl programs run.
  3. Make sure that the PostgreSQL client environment variables are properly set. Check, for example, PGDIR (the path to the installation directory), PGDATA (the path to the data files directory), etc. See the PostgreSQL documentation for more details.
  4. Check the database client locale settings (for example, set the PGCLIENTENCODING environment variable). The database client locale must match the locale used by the runtime system (LC_ALL,LANG).
  5. Verify the environment variable defining the search path for database client shared libraries (libpq.so on UNIX™, LIBPQ.DLL on Windows™). On UNIX platforms, the variable is specific to the operating system. For example, on Solaris and Linux™ systems, it is LD_LIBRARY_PATH, on AIX® it is LIBPATH, or HP/UX it is SHLIB_PATH. On Windows, you define the DLL search path in the PATH environment variable.
    Table 1. Shared library environment setting for PostgreSQL
    PostgreSQL version Shared library environment setting
    PostgreSQL 8.0 and higher

    UNIX: Add $PGDIR/lib to LD_LIBRARY_PATH (or its equivalent).

    Windows: Add %PGDIR%\bin to PATH.

  6. To verify if the PostgreSQL client environment is correct, you can start the PostgreSQL command interpreter:

    $ psql dbname -U appadmin -W

  7. Set up the fglprofile entries for database connections.
    Note: Make sure that you are using the ODI driver corresponding to the database client and server version. Because Informix® features emulation depend from the database server version, it is mandatory to use the same version of the database client and ODI driver as the server version.