ODBC breaks COUNTS, SEQUENCES as of Postgresql 7.3
ODBC breaks COUNTS, SEQUENCES as of Postgresql 7.3
От:
Alain Picard <Alain.Picard@memetrics.com>
Дата:
Dear ODBC users,
I have an application, written in lisp, which uses the unixODBC
driver manager (though I've tested what follows with iODBC, with
the same results). I have no real control over how the ODBC library
is being used in this application; it comes from a 3rd party vendor.
I'm trying to reverse engineer what they do via customer support and
inspecting the ODBC trace log files.
On the the problem.
With versions of Postgresql <= 7.2, I would obtain the following
results,
(select [count [*]] :from [foo])
=>
((73))
("count")
As of 7.3, I am now obtaining
(select [count [*]] :from [foo])
=>
(("73"))
("count")
Note the 73 is now "73". My understanding is that this is because as
of 7.3, postgresql now reports counts, sequences, etc as INTEGER8,
whereas they were previously INTEGER4.
I tried to switch to using the "official" postgresql ODBC driver,
psqlodbc, and compiled it from the sources in CVS. My thinking is
that they would track the changes in Postgresql more closely than the
unixODBC group.
Setting up a DSN to use this driver, I can no longer connect to the
back end:
XOS 23 > (connect "test_new_postgres/kooks")
Error: Sql-Database-Data-Error id HY092[28] : [unixODBC]ColAttribute for this type not implemented yet
1 (abort) Return to level 0.
2 Return to top loop level 0.
Type :b for backtrace, :c Re: ODBC breaks COUNTS, SEQUENCES as of Postgresql 7.3
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Alain Picard writes: > b) how to get 7.3 to return numbers via ODBC I dunno anything about fixing ODBC, but the standard advice for avoiding client-side problems with int8 is to cast the result of count(*) back to int4: select count(*)::integer from ... regards, tom lane