Re: 7.1 odbc bug & patch - Mailing list pgsql-patches

From Dave Bodenstab
Subject Re: 7.1 odbc bug & patch
Date
Msg-id 200106131627.f5DGR3005008@base486.home.org
Whole thread Raw
In response to 7.1 odbc bug & patch  (Dave Bodenstab <imdave@mcs.net>)
List 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


pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: use GUC for cmdline
Next
From: Chris Dunlop
Date:
Subject: Re: Australian timezone configure option