Show Table of Contents
8.9. Configure ODBC Options on Red Hat Enterprise Linux
Procedure 8.3. Configure ODBC Options on Red Hat Enterprise Linux
- Install the driver manager:
yum install unixODBC
- Verify that your PostGreSQLdriver has installed correctly:
odbcinst -q -d
- To create the DSN, open the configuration file in a text editor:
sudo vi /opt/redhat/odbc.ini
Note
You must either use sudo or be logged in as root to open this file. - Add the following configuration settings to the file:
[<DSN name>] Driver = /usr/lib/psqlodbc.so Description = PostgreSQL Data Source Servername = <Teiid Host name or ip> Port = 35432 Protocol = 7.4 UserName = <user-name> Password = <password> Database = <vdb-name> ReadOnly = no ServerType = Postgres ConnSettings = UseServerSidePrepare=1 ByteaAsLongVarBinary=1 Optimizer=0 Ksqo=0 Trace = No TraceFile = /var/log/trace.log Debug = No DebugFile = /var/log/debug.log
- Save the file and exit the text editor.
- Run this command to test the DSN:
isql <DSN-name> [<user-name> <password>] < commands.sql
To connect without DSN, use this DSN-less connection string:ODBC;DRIVER={PostgreSQL};DATABASE=<vdb-name>;SERVER=<host-name>;PORT=<port>;Uid=<username>;Pwd=<password>If you run isql but you encounter an error whereby you see this message: "Can't open lib '/opt/redhat/jboss-dv/v6/psqlodbc/lib64/psqlodbc.so' : file not found" it means that some of the postgres libraries are missing.To fix this issue, run this command as root:yum install postgresTo verify that the packages are now installed, run this command:rpm -qa|grep postYou should see the postgresql and postgresql-jdbc packages listed.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.