Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4

From: Ludek Finstrle <luf(at)pzkagis(dot)cz>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4
Date: 2005-12-06 14:28:11
Message-ID: 20051206142811.GA23334@soptik.pzkagis.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-odbc

Oh, I paste bad text and with combination of vi it gets into bad result.
I correct it now.

> We would like to upgrade the Postgres version from our current 7.3 but
> have problems with handling BLOBs via ODBC.
> We use unixODBC-2.2.11 and psqlodbc-08.01.0101.
> With postgres 7.3 lo type was mapped to SQL_C_BINARY and that's changed
> since postgres 7.4.
> Is it an ODBC or a driver issue? Are there any plans to fix the problem?

Hello,

Irina reports problem with ODBC. I take deep look at it and find that
libpq returns base type oid instead of type oid. I'll describe it better.
We have this test suite:

CREATE DOMAIN lo as oid;
CREATE TABLE justlo(b lo);

insert one row:
INSERT INTO justlo VALUES (lo_import('file'));

we try get it throught libpq (maybe I miss some command):
SELECT b FROM justlo;
- PQsetNoticeProcessor(pgconn, CC_handle_notice, qres);
- pgres = PQexec(pgconn,query);
- PQsetNoticeProcessor(pgconn, CC_handle_notice, NULL);
...
- typid = PQftype(pgres,i);
this returns typid = 26 (oid) instead of 25087 (lo)

postgres=# select oid from pg_type where typname='oid';
oid
-----
26
(1 row)
postgres=# select oid from pg_type where typname='lo';
oid
-------
25087
(1 row)

Is there any way to get 25087? It seems this behaviour is changed
between PgSQL 7.3 and 7.4. It looks like backend issue. Becouse it
returns different values with same binary for 7.3 and >= 7.4
(all PgSQL >= 7.4 returns typid = 26 - directly tested 7.4, 8.1).

Thanks a lot for help

Luf

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2005-12-06 15:05:01 Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4
Previous Message gribeiro 2005-12-06 13:15:43 pqexecparams and binary data

Browse pgsql-odbc by date

  From Date Subject
Next Message Tom Lane 2005-12-06 15:05:01 Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4
Previous Message noreply 2005-12-06 10:14:34 [ psqlodbc-Bugs-1000457 ] Autocommit and Cancel