X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id C90109DCCF1; Tue, 6 Dec 2005 10:28:29 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18097-06; Tue, 6 Dec 2005 10:28:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.pzkagis.cz (gis6.netbox.cz [83.240.30.214]) by postgresql.org (Postfix) with ESMTP id A1F1C9DCCC4; Tue, 6 Dec 2005 10:28:10 -0400 (AST) Received: (from luf@localhost) by smtp.pzkagis.cz (8.11.6/8.11.6) id jB6ESBH23354; Tue, 6 Dec 2005 15:28:11 +0100 Date: Tue, 6 Dec 2005 15:28:11 +0100 From: Ludek Finstrle To: pgsql-interfaces@postgresql.org Cc: pgsql-odbc@postgresql.org Subject: Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4 Message-ID: <20051206142811.GA23334@soptik.pzkagis.cz> References: <438B792D.6030802@bnl.gov> <20051205212806.GA17690@soptik.pzkagis.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051205212806.GA17690@soptik.pzkagis.cz> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/5 X-Sequence-Number: 5873 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