[unixODBC-dev] text driver disappeared from 2.2.13/14 ???

Stefan Radman Stefan.Radman at CTBTO.ORG
Tue Nov 25 22:48:04 GMT 2008


Tom,

Have you ever thought about automatic registration of drivers with the
DM during RPM installation?
This might save users some headache related to the editing of
odbcinst.ini (they usually end up on the unixODBC list;-)
Especially the MySQL, Postgresql and FreeTDS users would benefit from
such an automatism IMHO.

Below is an example from a self-packaged (oracle) driver.

Regards
Stefan

# macros for odbcinst.ini
%define driver_name %name
%define driver_path %{_libdir}/lib%{name}.so
%define setup_path %{_libdir}/lib%{name}S.so

%post
# register ODBC driver with driver manager
odbcinst=%{_bindir}/odbcinst # driver installation/removal utility
if dmver="`$odbcinst --version 2>&-`"; then # driver manager name and
version e.g. unixODBC 2.2.13
  if $odbcinst -q -d -n "%{driver_name}" 1>&- 2>&-; then
    echo 1>&2 "WARNING: %{driver_name} driver already registered with
$dmver"
  else
    echo 1>&2 "registering %{driver_name} driver with $dmver"
    $odbcinst -i -d -r <<EOF
[%{driver_name}]
Description     = %{summary}
Driver          = %{driver_path}
Setup           = %{setup_path}
EOF
    $odbcinst -q -d -n "%{driver_name}"
  fi
else
  echo 1>&2 "WARNING: $odbcinst not found - cannot register
%{driver_name} driver"
fi

%preun
# unregister ODBC driver from driver manager
odbcinst=%{_bindir}/odbcinst # driver installation/removal utility
if dmver="`$odbcinst --version 2>&-`"; then # driver manager name and
version e.g. unixODBC 2.2.5
  echo "unregistering %{driver_name} driver from $dmver"
  $odbcinst -u -d -n "%{driver_name}"
else
  echo 1>&2 "WARNING: $odbcinst not found - cannot unregister
%{driver_name} driver"
fi

-----Original Message-----
From: unixodbc-dev-bounces at mailman.unixodbc.org
[mailto:unixodbc-dev-bounces at mailman.unixodbc.org] On Behalf Of Tom Lane
Sent: Tuesday, 25 November, 2008 18:31
To: Development issues and topics for unixODBC
Subject: Re: [unixODBC-dev] text driver disappeared from 2.2.13/14 ???

Nick Gorham <nick.gorham at easysoft.com> writes:
> Tom Lane wrote:
>> I hope this is not intentional ... I know I've got users that will
>> be unhappy if the text driver disappears from Fedora.

> TBH, based on the lasck of feedback I get, I assumed that no one used 
> it. Seems I was wrong.

Well, Red Hat's gotten bug reports on it from paying customers, eg
https://bugzilla.redhat.com/show_bug.cgi?id=162676
so *somebody* out there is using it.

To my mind the text driver is useful because it allows testing unixODBC
without any dependency on any external database solution; though I grant
it might be too simplistic to be good for very much in that line.

> Its all still in the CVS, so can be packaged up on its own.

That would be a feasible solution I guess.

BTW, how come you removed the mysql driver as obsolete (which it was)
and kept the postgres driver (which is too)?  For Fedora/RHEL I'd prefer
to be shipping just the separately maintained mysql and postgres
drivers.

			regards, tom lane
_______________________________________________
unixODBC-dev mailing list
unixODBC-dev at mailman.unixodbc.org
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev


More information about the unixODBC-dev mailing list