Nip DATA Logo  
 

Contents



General Questions

How to install and configure PostgreSQL ODBC Driver ?


  •  Download the latest PostgreSQL source code from:
                http://www.postgresql.org/ftp/source/

For this presentation i used postgresql-8.2.3.tar.bz2

>tar jxpvf postgresql-8.2.3.tar.bz2

 After unzip-ing the archive  configure it like this:
>./configure  --prefix=/usr/local/postgeSQL-8.2.3 --enable-thread-safety --with-openssl
>make
>make install ( as root )


After we complete the PostgreSQL install, we can continue with the ODBC driver.

  •   Download the latest version of the ODBC driver source code from:
                 http://www.postgresql.org/ftp/odbc/versions/src/

I used psqlodbc-08.02.0400.tar.gz for this presentation.

>tar zxpvf psqlodbc-08.02.0400.tar.gz

 After unzip-ing the archive configure it like this:
>LDFLAGS=-lssl ./configure --prefix=/usr/local/postgreSQLODBC --with-iodbc
>make
>make install ( as root )


  If the previous builds are successfully  we can now start configure the Driver Manager and add the new build driver: /usr/local/postgreSQLODBC/lib/psqlodbcw.so
 
  •   Setup  the ODBC configuration files. 
        In the ~/Library/ODBC we can find the ODBC config files.   odbcinst.ini should include the new driver that we added through the ODBC Driver Manager:

> cat odbcinst.ini

[ODBC Drivers]
pgsql = Installed

[pgsql]
Driver = /usr/local/postgreSQLODBC/lib/psqlodbcw.so
Setup  =

[ODBC Connection Pooling]
PerfMon    = 0
Retry Wait =

 In the odbc.ini we can now add the new PostgreSQL server connection data:

>cat odbc.ini

[ODBC Data Sources]
testdb = pgsql

[testdb]
Description       = PostgreSQL
Driver            = /usr/local/postgreSQLODBC/lib/psqlodbcw.so
Trace             = No
TraceFile         =
Database          = testdb
Servername        = 192.168.10.1
Username          = marian
Password          =
Port              = 5432
Protocol          = 6.4
ReadOnly          = No
RowVersioning     = No
ShowSystemTables  = No
ShowOidColumn     = No
FakeOidIndex      = No
ConnSettings      =
UpdatableCursors  = No

[ODBC]
Trace         = 0
TraceAutoStop = 0
TraceFile     =
TraceLibrary  =

  •    Test the new connection.
           After the config files are set up, we can check to connect using tksql.
  > tksql  UID/PWD@DSN
Connected to:
 testdb

SQL>

  Check if there are any errors and try to fix them.
For any questions, please send us an email.