Re: ODBC Version supporting specif databases?

From: Bruce McAlister <bruce(dot)mcalister(at)blueface(dot)ie>
To: pgsql-odbc(at)postgresql(dot)org, unixodbc-support(at)easysoft(dot)com
Subject: Re: ODBC Version supporting specif databases?
Date: 2008-02-29 08:11:40
Message-ID: 47C7BE3C.5080607@blueface.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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

Attachment Content-Type Size
build_script.ksh text/plain 3.4 KB
trace_debug_commlog.zip application/octet-stream 7.1 KB

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Premsun Choltanwanich 2008-03-03 07:06:03 PostgreSQL does not support updateable cursors
Previous Message Rainer Bauer 2008-02-29 00:01:59 Re: Odd memory leak or crash