Re: 7.1 odbc bug & patch

From: Dave Bodenstab <imdave(at)mcs(dot)net>
To: Inoue(at)tpf(dot)co(dot)jp, pgman(at)candle(dot)pha(dot)pa(dot)us
Cc: imdave(at)mcs(dot)net, pgsql-patches(at)postgresql(dot)org
Subject: Re: 7.1 odbc bug & patch
Date: 2001-06-13 16:27:03
Message-ID: 200106131627.f5DGR3005008@base486.home.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

As long as I'm on the cc list here... let me add $.02

What little documentation I found was in:

postgresql-7.1/doc/postgres/odbc-install.html

In section 7.2 Installation, it states:

The installation-wide configuration file odbcinst.ini will be
installed into the directory /usr/local/pgsql/etc/, or equivalent,
depending on what --prefix and/or --sysconfdir options you supplied
to configure. Since this file can also be shared between different
ODBC drivers you can also install it in a shared location. To do
that, override the location of this file with the --with-odbcinst
option.

This led *me* to believe that when I configure and install postgress
with:

--enable-odbc \
--with-odbcinst=/usr/local/etc \

then postgress would actually *use* /usr/local/etc/odbcinst.ini.
It didn't. There was no mention of looking in the current directory
or looking in $HOME. When I ktrace'd my test program, I found that
an odbcinst.ini file *was* being searched for, but only in . and
$HOME. Finally tracking it down, I found the reason in gpps.c (and
found questionable and buggy code also.) In fact, the only reference
to the installed odbcinst.ini (ODBCINST_INI) is in dlg_specific.c,
in code that is never called unless WIN32 is #defined, and even if
#defined, it's attempting to *update* the file. It was obvious
that the code did not match the available doc's. Since it wasn't
obvious whether or not odbcinst.ini should be searched for in .
and $HOME, I left that logic alone. I only added a final search
for ODBCINST_INI which, finally, makes it do what the documentation
states that it should. (The buggy code is another story... that
should be removed/fixed regardless of whether the search is
augmented.) End of story... the patch got things working.

There are, perhaps, other problems... I don't know. I only played
with this stuff in an attempt to learn about ``odbc'' stuff. When
I ktrace'd libiodbc, it wanted its own "odbc.ini" file. I would
think that they would use the same file name... but since I don't
have any doc's on how things are supposed to work, I have not investigated
further. In any event, both libiodbc and tclodbc require database
specific libraries -- for postgres, src/interfaces/odbc/ -- so I
would expect that postgres would supply working (with respect to
its own documentation) code.

Dave Bodenstab

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Marko Kreen 2001-06-13 16:44:33 Re: reset all update
Previous Message Bruce Momjian 2001-06-13 15:54:28 Re: Patch to include PAM support...