此内容没有您所选择的语言版本。

8.9. Configure ODBC Options on Red Hat Enterprise Linux


Procedure 8.3. Configure ODBC Options on Red Hat Enterprise Linux

  1. Install the driver manager:
    yum install unixODBC
    Copy to Clipboard Toggle word wrap
  2. Verify that your PostGreSQLdriver has installed correctly:
    odbcinst -q -d
    Copy to Clipboard Toggle word wrap
  3. To create the DSN, open the configuration file in a text editor:
    sudo vi /opt/redhat/odbc.ini
    Copy to Clipboard Toggle word wrap

    Note

    You must either use sudo or be logged in as root to open this file.
  4. 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 
    
    Copy to Clipboard Toggle word wrap
  5. Save the file and exit the text editor.
  6. Run this command to test the DSN:
      isql <DSN-name> [<user-name> <password>] < commands.sql 
    
    Copy to Clipboard Toggle word wrap
    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> 
    
    Copy to Clipboard Toggle word wrap
    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 postgres
    To verify that the packages are now installed, run this command: rpm -qa|grep post
    You should see the postgresql and postgresql-jdbc packages listed.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat