Page 1 of 2

ODBC Driver for PostGreSQL

Posted: Mon Dec 04, 2017 6:39 pm
by rdonnay
Is anyone using an ODBC driver for PostGreSQL?

I installed the Devart ODBC Driver for PostgreSQL and I can make a connection successfully, however I cannot get any SELECT statements to work.

cConnect := "DBE=odbcdbe;DRIVER=Devart ODBC Driver for PostgreSQL;"
cConnect += "SERVER=localhost;DB=northwind;UID=postgres;PWD=" + GetEnv('POSTGRESQL_PASSWORD')

SELECT * from customer gives the following error:

[HY000][0][Devart][ODBC][PostgreSQL]relation "customer" does not exist

No problem when using SELECT statements from PgAdmin.

Re: ODBC Driver for PostGreSQL

Posted: Mon Dec 04, 2017 10:24 pm
by Auge_Ohr
did you used the 32bit ODBC Driver ... :whistle:

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 8:13 am
by rdonnay
did you used the 32bit ODBC Driver
Yes, it is. It would not have even connected if it were the 64 bit.
I am thinking that the problem may be related to versions.

This is an ODBC driver for PostGreSQL 2.2.

This is confusing, because I'm using 8.3 (the version from the Alaska website).
I need to figure this out.

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 8:29 am
by rdonnay
This is an ODBC driver for PostGreSQL 2.2.
That's what it says on their download page.
That cannot be correct. This is Devart's version number.
I just found more info that it is compatible with PostGreSQL version 10.

I'm still asking the question: Is anyone using the ODBCDBE with PostGreSQL server?

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 12:01 pm
by rdonnay
I figured it out.

The connection ignored DB=northwind in the connection string.
The correct syntax is Database=northwind.

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 12:17 pm
by unixkd
Let us know how it perform

That is the real concern

Joe

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 12:35 pm
by rdonnay
Let us know how it perform
I am having a lot of problems.
I suspect that the Xbase++ ODBCDBE will not work with PostGreSQL.
It isn't even listed in the documentation under ODBCDBE.

Some SELECT statements work.
Others will give an error on dbSkip().

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 2:05 pm
by unixkd
I really think that Alaska made a mistake by developing a DBE for postgresql. It would have been better to do something similar to SQLExpress that can use any DBMS. May be invest heavily in ODBCDBE for example instead of DBE for A and another DBE for B. As at today majority of Xbase++ developers dont use ODBCDBE or PGDBE as it were. I stand to be corrected. The only client/server DBE that is really doing fine is ADSDBE.

Joe

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 2:53 pm
by rdonnay
The only client/server DBE that is really doing fine is ADSDBE.
ADSDBE is very good and is my favorite, however I have had good success with ODBCDBE and Microsoft SQLServer.

Re: ODBC Driver for PostGreSQL

Posted: Tue Dec 05, 2017 3:37 pm
by rdonnay
It appears that many of my problems are due to the ODBC driver I was using - Devart.

I installed the postgreSQL Unicode driver from https://www.postgresql.org/ftp/odbc/versions/msi/ and am now getting much better results.

Testing is continuing.