Nip DATA Logo  


General Questions

How to install and configure PostgreSQL ODBC Driver ?

  •  Download the latest PostgreSQL source code from:

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 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:

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 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/
  •   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

Driver = /usr/local/postgreSQLODBC/lib/
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

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

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:


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