bug in ODBC driver (and fix)

Поиск
Список
Период
Сортировка
Искать

bug in ODBC driver (and fix)

От:
Mindaugas Idzelis <mai3116@ritvax.isc.rit.edu>
Дата:
I can't show any tables using the ODBC driver. There is something wrong with
the query it uses to select the tables. The query it is using is:

select relname, usename, relhasrules from pg_class, pg_user where relkind =
'r' and relname !~ '^pg_|^dd_' and relname !~ '^xinv[0-9]+' and
int4out(usesysid) = int4out(relowner)order by relname

and it should be:

select relname, usename, relhasrules from pg_class, pg_user where relkind =
'r' and relname !~ '^pg_|^dd_' and relname !~ '^xinv[0-9]+' and usesysid =
relowner order by relname

the int4out() function should be removed. I am using version 6.5 of the ODBC
driver. Is there a patch that makes this work? Thank you.

The 1 line change should be done in the file info.c.
(please reply to my email address mai3116@rit.edu as i am not a mailing list
subscriber)


Re: bug in ODBC driver (and fix)

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Mindaugas Idzelis  writes:
> the int4out() function should be removed.

Yes, it should.  This is fixed as of 7.0.3, IIRC.
		regards, tom lane

Re: bug in ODBC driver (and fix)

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Mindaugas Idzelis  writes:
> If it was fixed in 7.0.3, it has not yet been fixed in 7.1beta3.

Oh?  I'm quite sure there is no reference to int4out in ODBC now.
Look for yourself if you don't believe me.  That patch was applied
to the main branch back in August.

Are you sure you are using a driver built from the current ODBC sources,
and not 7.0.2 or earlier?

> Also, what is wrong with the following sql query?
> create unique index primary on tablename ( tableid );

PRIMARY is an SQL reserved word.
		regards, tom lane

RE: bug in ODBC driver (and fix)

От:
Mindaugas Idzelis <mai3116@ritvax.isc.rit.edu>
Дата:
If it was fixed in 7.0.3, it has not yet been fixed in 7.1beta3. In which
case, I have taken the source for the ODBC driver version 6.5 patched it
without the int4out() function, and compiled it. The driver is available at
http://neovintage.com/postgresODBC. This should help anyone using ODBC with
7.1beta3.

By the way. How come one of my applications (platinum erwin) does not get
any primary (or foreign) key information from the ODBC driver. When I was
using mySQL with the myODBC driver it got primary key information.

Also, what is wrong with the following sql query?
create unique index primary on tablename ( tableid );
this works:
create unique index primary2 on tablename (tableid );

it's allegedly a parse error. (in the database as well as the ODBC driver)

thank you.

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Friday, January 19, 2001 10:45 AM
To: Mindaugas Idzelis
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] bug in ODBC driver (and fix)


Mindaugas Idzelis  writes:
> the int4out() function should be removed.

Yes, it should.  This is fixed as of 7.0.3, IIRC.
		regards, tom lane


Re: bug in ODBC driver (and fix)

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Mindaugas Idzelis  writes:
> [ precompiled ODBC drivers seem to be out of date ]

Could be.  I don't know who's maintaining those things ...
		regards, tom lane

RE: bug in ODBC driver (and fix)

От:
Mindaugas Idzelis <mai3116@ritvax.isc.rit.edu>
Дата:
The ODBC driver I had problems with is found at:
ftp://ftp.postgresql.org/pub/odbc/latest/postdrv.exe

This is apparently revision v06-50-0000. I patched the sources to this
particular version. I just realized that there is a copy of the odbc driver
in the postgresql source tree. I'm going to try to compile that with visual
c++ 6.0 now.

RE: bug in ODBC driver (and fix)

От:
Max Khon <fjoe@iclub.nsu.ru>
Дата:
hi, there!

On Fri, 19 Jan 2001, Mindaugas Idzelis wrote:

> The ODBC driver I had problems with is found at:
> ftp://ftp.postgresql.org/pub/odbc/latest/postdrv.exe
> 
> This is apparently revision v06-50-0000. I patched the sources to this
> particular version. I just realized that there is a copy of the odbc driver
> in the postgresql source tree. I'm going to try to compile that with visual
> c++ 6.0 now.
> 
> 

RE: bug in ODBC driver (and fix)

От:
Paul Breen <pbreen@computerpark.co.uk>
Дата:
Hello Mindaugas,

> Got it to compile correctly, however, it doesn't link correctly. It's
> gettin some unresolved external symbols... by the looks of which look
> like its targeted to the unix platform. 

It's not targeted for the unix platform, all of these function calls are
Winsock.dll calls (Microsoft's BSD-ish sockets implementation).  I would 
imagine the ODBC driver links to the dll at runtime (I seem to remember
that you need a definitions?? file to pull in Winsock calls at runtime).
If not you can link against the static library Wsock32.lib.

The ODBC driver uses TCP/IP socket calls to talk between your client and
the Postgres backend, thats why these calls are needed.

Hope this helps...

Paul M. Breen, Software Engineer - Computer Park Ltd.
Tel:   (01536) 417155
Email: pbreen@computerpark.co.uk

On Fri, 19 Jan 2001, Mindaugas Idzelis wrote:

> The ODBC driver I had problems with is found at:
> ftp://ftp.postgresql.org/pub/odbc/latest/postdrv.exe
> 
> This is apparently revision v06-50-0000. I patched the sources to this
> particular version. I just realized that there is a copy of the odbc driver
> in the postgresql source tree. I'm going to try to compile that with visual
> c++ 6.0 now.
> 
> 
FAQ