Re: UNRESOLVED: odbc driver manager and postgresql odbc driver

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: ricardd(at)mathstat(dot)dal(dot)ca
Cc: unixodbc-support(at)easysoft(dot)com, pgsql-odbc(at)postgresql(dot)org
Subject: Re: UNRESOLVED: odbc driver manager and postgresql odbc driver
Date: 2006-06-14 20:44:30
Message-ID: 4490752E.5060302@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc


> 2 - postgresql needs an odbc driver so that it can be accessible through ODBC
>
> 3 - get unixodbc up and running to enable ODBC on the system by using the
> above driver to connect to postgresql
>
>
> So I'm still at #2/#3. Here is what I don't understand:
>
> 1 - Is the postgresql driver procided by unixodbc appropriate or obsolete?

You should use the postgresql driver that is provided by the
distribution you are running. If you are running windows download the exe.

So for Ubuntu:

apt-get install odbc-postgresql

> I don't really understand earlier replies on this (see below). The Ubuntu
> packages "unixodbc-bin" and "unixodbc-dev" don't seem to include a
> postgreSQL driver, but the latest source code does. So I removed the
> packages and I'm now trying to build unixodbc from source. I get a build
> error from "lex.l" and can't access a promising message on the mailing
> list archive
> (mail.easysoft.com/pipermail/unixodbc-announce/2006-January/000004.html).
> I'm stuck.

odbc-postgresql is the driver
unixODBC is the driver manager.

So:

apt-get install unixodbc

> 2 - Is the Ubuntu package "odbc-postgresql" essentially the same as
> building psqlodbc from source?

Essentially yes. THe psqlodbc is probably more current but don't make
your life difficult.

If so, is this better than the unixodbc
> postgresql driver? Also, how do I use this driver in unixodbc since it
> doesn't have a "setup file"? Should I use iODBC instead of unixodbc?
>

No. Use unixODBC.

> 3 - What is the "setup file" supposed to look like anyway? I'd be happy to
> create it if I knew what it is supposed to be. Why is it so hard to find?
> I have the postgresql people telling me that it isn't from them but I
> couldn't find it from the unixodbc-bin and unixodbc-dev packages either.

Here are example working files:

/etc/odbc.ini:

[odbcng]
Description = Mammoth PostgreSQL
Driver = nobuffer
Trace = No
TraceFile =
Database = postgres
Servername = localhost
UserName = postgres
Password =
Port = 5432
Protocol = 7.0
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =

/etc/odbcinst.ini:

[pgdg]
Description = PostgreSQL ODBC driver
Driver = /usr/lib/odbc/psqlodbc.so
Setup = /usr/lib/odbc/libodbcpsqlS.so
Debug = 0
CommLog = 1
UsageCount = 2

[nobuffer]
Description = PostgreSQL ODBC driver
Driver = /usr/local/lib/libmodbc.so
Debug = 0
CommLog = 1
UsageCount = 2
USE_BUFFERING = False

> I had similar trouble setting this up last time and ended up leaving the
> configuration to a sysadmin. It would be really good to be able to solve
> this by myself this time around. I had odbc access to postgresql last week
> before a forced reinstall. How I miss it now!
>
> Apologies for my ignorance but rest assured that learning is taking place.
> Cheers,

I am curious why you are using ODBC to connect to PostgreSQL if you are
on Dapper? Are you using Open Office or somethign like that?

Sincerely,

Joshua D. Drake

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message ricardd 2006-06-14 20:55:31 Re: UNRESOLVED: odbc driver manager and postgresql odbc
Previous Message ricardd 2006-06-14 19:37:04 UNRESOLVED: odbc driver manager and postgresql odbc driver in Ubuntu