[unixODBC-support] Re: [ODBC] ODBC Version supporting specif databases?

Bruce McAlister bruce.mcalister at blueface.ie
Fri Feb 29 08:11:40 GMT 2008


Hi All,

Sorry for cross-posting, but I would appreciate all the help I can get 
to try and get to the bottom of this issue.

I have now tried 3 versions of the pgsqlODBC driver, of which

08.03.0100, and
08.02.0500

fail with the following error code when attempting to connect to a database:

[IM005][unixODBC][Driver Manager]Driver's SQLAllocHandle on 
SQL_HANDLE_DBC failed

The only driver that is able to successfully connect to the database is 
the 08.01.0200 version of the driver.

To try and assist in finding what it is that is going wrong (or 
potentially, what I am doing wrong), I will outline how I have built the 
driver and how I am attempting to connect.

I have attached the script that I have used to build PostgreSQL 8.2.6, 
and all three versions of the pgsqlODBC driver, this will illustrate the 
environment and build options I have specified.

The OS I am building on is Solaris 10 Update 3. The version of unixODBC 
I am using is v2.2.12 built from source. The database I am trying to 
connect to is PostgreSQL v8.2.6.

my odbcinst.ini file looks like this:

--------------------------------------------------------------------------
[ODBC]
Trace = yes
TraceFile = /tmp/trace.log

[PostgreSQL]
Description = PostgreSQL Official ODBC Driver
Driver = /opt/blueface/lib/psqlodbcw.so
Debug = 1
CommLog = 1
--------------------------------------------------------------------------

my odbc.ini file looks like this:

--------------------------------------------------------------------------
[blueface-services]
Description = Services Database
Driver = PostgreSQL
Database = blueface-service
Servername = 192.168.10.181
UserName = username
Password = password
Port = 5432
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =
--------------------------------------------------------------------------

I cannot find any commlog or debug logs for 08.03.0100 or 08.02.0500 
anywhere. I assume this to be because the driver fails before it can 
even initialize its own logging.

Here is the output of "ldd -r [pgsqlODBC driver]" for each of the three 
deivers:

08.03.0100
--------------------------------------------------------------------------
ldd -r ./psqlodbcw.so
         libpq.so.5 =>    /opt/postgresql-8.2.6/lib/libpq.so.5
         libpthread.so.1 =>       /lib/libpthread.so.1
         libodbcinst.so.1 =>      /opt/blueface/lib/libodbcinst.so.1
         libodbc.so.1 =>  /opt/blueface/lib/libodbc.so.1
         libc.so.1 =>     /lib/libc.so.1
         libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1
         libssl.so.0.9.7 =>       /usr/sfw/lib/libssl.so.0.9.7
         libcrypto.so.0.9.7 =>    /usr/sfw/lib/libcrypto.so.0.9.7
         libsocket.so.1 =>        /lib/libsocket.so.1
         libdl.so.1 =>    /lib/libdl.so.1
         libthread.so.1 =>        /lib/libthread.so.1
         libnsl.so.1 =>   /lib/libnsl.so.1
         libmp.so.2 =>    /lib/libmp.so.2
         libmd.so.1 =>    /lib/libmd.so.1
         libscf.so.1 =>   /lib/libscf.so.1
         libdoor.so.1 =>  /lib/libdoor.so.1
         libuutil.so.1 =>         /lib/libuutil.so.1
         libgen.so.1 =>   /lib/libgen.so.1
         libm.so.2 =>     /lib/libm.so.2
--------------------------------------------------------------------------

08.02.0500
--------------------------------------------------------------------------
ldd -r ./psqlodbcw.so
         libpq.so.5 =>    /opt/postgresql-8.2.6/lib/libpq.so.5
         libpthread.so.1 =>       /lib/libpthread.so.1
         libodbcinst.so.1 =>      /opt/blueface/lib/libodbcinst.so.1
         libodbc.so.1 =>  /opt/blueface/lib/libodbc.so.1
         libc.so.1 =>     /lib/libc.so.1
         libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1
         libssl.so.0.9.7 =>       /usr/sfw/lib/libssl.so.0.9.7
         libcrypto.so.0.9.7 =>    /usr/sfw/lib/libcrypto.so.0.9.7
         libsocket.so.1 =>        /lib/libsocket.so.1
         libdl.so.1 =>    /lib/libdl.so.1
         libthread.so.1 =>        /lib/libthread.so.1
         libnsl.so.1 =>   /lib/libnsl.so.1
         libmp.so.2 =>    /lib/libmp.so.2
         libmd.so.1 =>    /lib/libmd.so.1
         libscf.so.1 =>   /lib/libscf.so.1
         libdoor.so.1 =>  /lib/libdoor.so.1
         libuutil.so.1 =>         /lib/libuutil.so.1
         libgen.so.1 =>   /lib/libgen.so.1
         libm.so.2 =>     /lib/libm.so.2
--------------------------------------------------------------------------

08.01.0200
--------------------------------------------------------------------------
ldd -r ./psqlodbcw.so
         libodbcinst.so.1 =>      /opt/blueface/lib/libodbcinst.so.1
         libpq.so.5 =>    /opt/postgresql-8.2.6/lib/libpq.so.5
         libc.so.1 =>     /lib/libc.so.1
         libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1
         libdl.so.1 =>    /lib/libdl.so.1
         libthread.so.1 =>        /lib/libthread.so.1
         libssl.so.0.9.7 =>       /usr/sfw/lib/libssl.so.0.9.7
         libcrypto.so.0.9.7 =>    /usr/sfw/lib/libcrypto.so.0.9.7
         libsocket.so.1 =>        /lib/libsocket.so.1
         libpthread.so.1 =>       /lib/libpthread.so.1
         libnsl.so.1 =>   /lib/libnsl.so.1
         libmp.so.2 =>    /lib/libmp.so.2
         libmd.so.1 =>    /lib/libmd.so.1
         libscf.so.1 =>   /lib/libscf.so.1
         libdoor.so.1 =>  /lib/libdoor.so.1
         libuutil.so.1 =>         /lib/libuutil.so.1
         libgen.so.1 =>   /lib/libgen.so.1
         libm.so.2 =>     /lib/libm.so.2
--------------------------------------------------------------------------

The failure messages I get are as follows:

08.03.0100
--------------------------------------------------------------------------
isql -vvv blueface-services
[IM005][unixODBC][Driver Manager]Driver's SQLAllocHandle on 
SQL_HANDLE_DBC failed
[ISQL]ERROR: Could not SQLConnect
--------------------------------------------------------------------------

08.02.0500
--------------------------------------------------------------------------
isql -vvv blueface-services
[IM005][unixODBC][Driver Manager]Driver's SQLAllocHandle on 
SQL_HANDLE_DBC failed
[ISQL]ERROR: Could not SQLConnect
--------------------------------------------------------------------------

I have attached the trace/commlog/debug logs of all three drivers, the 
08.01.0200 logs are of a successful connection, the rest are failures. 
In the case of the failures, there are no commlog/debug logs generated.

If you require any additional information, please dont hesitate to ask.

Thanks
Bruce
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: build_script.ksh
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20080229/8b277df8/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trace_debug_commlog.zip
Type: application/octet-stream
Size: 7282 bytes
Desc: not available
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20080229/8b277df8/attachment.obj>


More information about the unixODBC-support mailing list