Configuration through the system information (odbc.ini) file
- Last Updated: March 4, 2024
- 3 minute read
- DataDirect Connectors
- ODBC
- PostgreSQL 8.0
- Documentation
In the UNIX and Linux environments, a system information file is used to store data source information. Setup installs a default version of this file, called odbc.ini, in the product installation directory. This is a plain text file that contains data source definitions.
To configure a data source manually, you edit the odbc.ini file with a text editor. The content of this file is divided into three sections.
Refer to Character encoding in the odbc.ini and odbcinst.ini files in Progress DataDirect for ODBC Drivers Reference for details.
At the beginning of the file is a section named [ODBC Data Sources] containing data_source_name=installed-driver pairs, for example:
PostgreSQL Wire Protocol=DataDirect 8.0 PostgreSQL Wire Protocol
The driver uses this section to match a data source to the appropriate installed driver.
The [ODBC
Data Sources] section also includes data source definitions. The default
odbc.ini contains a data source definition for the
driver. Each data source definition begins with a data source name in square brackets, for
example, [PostgreSQL Wire Protocol]. The data source
definitions contain connection string attribute=value pairs with
default values. You can modify these values as appropriate for your system. "Connection
Option Descriptions" describes these attributes. See "Sample Default odbc.ini File" for
sample data sources.
The second section of the file is named [ODBC File DSN] and includes one keyword:
[ODBC File DSN]
DefaultDSNDir=
This keyword defines the path of the default location for file data sources (see "File data sources").
The third section of the file is named [ODBC] and includes several keywords, for example:
[ODBC]
IANAAppCodePage=4
InstallDir=/opt/odbc
Trace=0
TraceFile=odbctrace.out
TraceDll=/opt/odbc/lib/ivtrc28.so
ODBCTraceMaxFileSize=102400
ODBCTraceMaxNumFiles=10
The IANAAppCodePage keyword defines the default value that the UNIX/Linux driver uses if individual data sources have not specified a different value. See "IANAAppCodePage" in the "Connection option descriptions" for details
For supported code page values, refer to Code page values in the Progress DataDirect for ODBC Drivers Reference.
The InstallDir keyword must be included in this section. The value of this keyword is the path to the installation directory under which the /lib and /locale directories are contained. The installation process automatically writes your installation directory to the default odbc.ini file.
For example, if you choose an installation location of
/opt/odbc, then the following line is written
to the [ODBC] section of the default odbc.ini:
InstallDir=/opt/odbc
[ODBC] section information in the [ODBC] section of the odbcinst.ini
file. The driver and Driver Manager always check first in the [ODBC] section of an odbc.ini file.
If no odbc.ini file exists or if the odbc.ini file does not contain an [ODBC] section, they check for an [ODBC]
section in the odbcinst.ini file. See "DSN-less
connections" for details.ODBC tracing allows you to trace calls to the ODBC driver and create a log of the traces for troubleshooting purposes. The following keywords all control tracing: Trace, TraceFile, TraceDLL, ODBCTraceMaxFileSize, and ODBCTraceMaxNumFiles.
For a complete discussion of tracing, refer to ODBC trace in the Progress DataDirect for ODBC Drivers Reference.