UNIX: Create Datastore Data Sources for PostgreSQL

Use these steps to create the ODBC data sources required to access datastore databases.

There are a number of different driver managers that you can use to configure an ODBC data source. These instructions are carried out using unixODBC. If you are using a different driver manager, consult the vendor instructions for creating data sources.

  1. Run the command odbcinst -j command, and note down the location of the drivers configuration file (odbcinst.ini) and the user data sources configuration file (.odbc.ini).
  2. Open the odbcinst.ini configuration file and ensure that you have something similar to the following:

    (This may differ depending on the version of PostgreSQL you are running.)

    [PostgreSQL]
    Description=ODBC for PostgreSQL
    Driver64=/usr/pgsql-10/lib/psqlodbcw.so
    Setup64=/usr/lib64/libodbcpsqlS.so
    FileUsage=1
    Threading=2
    Note: Ensuring that the Threading setting is specified avoids potential problems when performing database operations on multiple threads.
  3. Open the .odbc.ini configuration file and add an entry for the mandatory data source:
    [<datasource-name>]
    Driver = <driver-name>
    Servername = <server-name>
    Port = <port-no>
    Database = postgres
    KeepaliveTime=<int>
    KeepaliveInterval=<int>
    BatchSize=100
    where:
    • <datasource-name> - a name for the data source.
    • <driver-name> - the name of the driver as configured in the .odbc.ini file; in the example above, that would be PostgreSQL.
    • <server-name> - the name of the server on which the database instance resides.
    • <port-no> - the port on which the database is listening.
    • postgres - one of the default databases supplied with a PostgreSQL server.
    • <int> - the number of seconds in which the connection will remain active whilst being idle - you may need to experiment with this value, depending on the database's workload.
    Note: The BatchSize parameter is a setting to aid I/O performance.
  4. Add a new data source entry for each required datastore:
    [<datasource-name>]
    Driver = <driver-name>
    Servername = <server-name>
    Port = <port-no>
    Database = MicroFocus$SEE$Files$<datastore-name>
    KeepaliveTime=<int>
    KeepaliveInterval=<int>
    BatchSize=100
    where:
    • <datastore-name> - the name of the datastore that you want to create.
  5. Save the .odbc.ini configuration file.

Example .odbc.ini file

The following is an example of an .odbc.ini configuration file contains data sources for a local PostgreSQL database instance with two datastores. It also includes the mandatory data source for the PostgreSQL database.

[PG.POSTGRES]
Driver = PostgreSQL
Servername = localhost
Port = 5432
Database = postgres
KeepaliveTime=120
KeepaliveInterval=120
BatchSize=100

[PG.VSAM]
Driver = PostgreSQL
Servername = localhost
Port = 5432
Database = MicroFocus$SEE$Files$VSAM
KeepaliveTime=120
KeepaliveInterval=120
BatchSize=100

[PG.SEQFILES]
Driver = PostgreSQL
Servername = localhost
Port = 5432
Database = MicroFocus$SEE$Files$SEQ
KeepaliveTime=120
KeepaliveInterval=120
BatchSize=100
Next, you must create or edit the MFDBFH configuration file, so that it contains entries to each of your datastore data sources, and the data source for the mandatory database.