[unixODBC-dev] unixODBC postgres driver vs. pgsqlodbc

martin.evans at easysoft.com martin.evans at easysoft.com
Fri Mar 4 23:49:00 GMT 2005

Just in case anyone is reading this news group and wondering what is going
on with Postgres/MyODBC etc in unixODBC i just thought it was worth
making the point as to why these drivers ended up in unixODBC.

Way back in the depths of time there wasn't a viable ODBC driver manager
for UNIX. Peter started unixODBC and Nick has furthered it to the point
where it is pretty much a mirror of the Windows ODBC driver manager (arguably
better since it has to support things like UNICODE on many different
UNIX platforms (and even OpenVMS) and this isn't even mentioning the different
GUI toolkits (whereas Windows only has to deal with one).

Drivers like postgres, myodbc etc were linked to directly from ODBC applications
and they didn't know about unixODBC so ODBC didn't work like it does on Windows
(e.g. is driver stored its configuration in diffrent files)

In other words applications had no way of calling SQLDrivers / SQLDataSources /
SQLGetPrivateProfileString etc (all the APIS which the driver manager supplies).
These drivers were changed to recognise unixODBC (in the unixODBC distributions)
and this opened up ODBC for UNIX and this is where the separation of the drivers
occurred. This was necessary to further ODBC on UNIX and for various reasons the
changes took time to work their way back into the official drivers. 

Now that unixODBC is the premier ODBC driver manager for unix the main
distributions of many ODBC drivers know about the unixODBC driver manager
and interoperate with it fine. There are issues still unresolved completely
- like not all ODBC drivers not using odbcinst or SQLInstallDriver to install
themselves under the unixODBC driver manager and there is considerable
talk about RedHat/Mandrake/Debian etc (all GNU/Linux at heart) having packages
for the ODBC driver that depend on unixODBC - that is fine but the whole world
is not Linux.

To summarise, all ODBC drivers need to:

a) install themselves under unxiODBC
   i.e. use SQLInstallDriver or odbcinst (as happens in Windows)

b) be capable of using SQLGetPrivateProfileString to obtain driver-specific
   attributes from the driver manager defined odbc.ini.

These were the original reasons for splitting various ODBC drivers
into unixODBC and so long as ODBC drivers recognise the existence of
unixODBC there should be no reason to include those ODBC drivers with

For instance, many will know I work for Easysoft and although we distribute
parts of the unixODBC driver manager you do not NEED to install it from our
distributions. We do all we can to detect an already installed unixODBC
and then use odbcinst to install the driver under unixODBC and odbcinst
to install a DSN under unixODBC. Later, when the driver is run we load
libodbcinst.XX to use SQLGetPrivateProfileString so we can obtain the
driver-specific attributes from the ini file unixODBC is using.

So, yes, postgres etc could go from the unixODBC distribution but the
maintainers of those drivers should ensure they interoperate with unixODBC
and then we (as developers) will be able to write ODBC applications which
we know will work on UNIX platforms in the same way they do under Windows.
i.e. we can write our ODBC applications which depend on libodbc.XX and know
that we can load libodbcinst.so to use SQLGetPrivateProfileString.

If anyone needs further information to make their ODBC driver work under 
unixODBC they can contact us on this news group and we will
try our best to help them out.


More information about the unixODBC-dev mailing list