pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Herbert <Marc.Herbert@emicnetworks.com>
To: pgsql-jdbc@postgresql.org
Subject: getObject(<oid>) returns integer instead of LargeObject handle ?
Date: Fri, 22 Jul 2005 15:56:40 +0200
Message-ID: <20050722135640.GM7394@emicnetworks.com> (raw)

Hi,

 Is there some good reason for getObject(<some oid column>) to return the
bare oid integer instead of the actual LargeObject handle ?

 I slightly modified the driver as below and it fixed my Blob issues
without any other side-effects. Would have some extensive testing
shown some problems I missed ?  Sorry for not being very familiar with
Postgres' oids.

Thanks in advance.

Cheers,

Marc.


inline patch 1: postgresql/jdbc2/TypeInfoCache.java (+1/-1 lines) download inline-1.patchIndex: postgresql/jdbc2/TypeInfoCache.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/TypeInfoCache.java,v retrieving revision 1.1 diff -u -r1.1 TypeInfoCache.java --- postgresql/jdbc2/TypeInfoCache.java 10 Apr 2005 21:54:16 -0000 1.1 +++ postgresql/jdbc2/TypeInfoCache.java 22 Jul 2005 13:45:35 -0000 @@ -51,7 +51,7 @@ private static Object types[][] = { {"int2", new Integer(Oid.INT2), new Integer(Types.SMALLINT), "java.lang.Short"}, {"int4", new Integer(Oid.INT4), new Integer(Types.INTEGER), "java.lang.Integer"}, - {"oid", new Integer(Oid.OID), new Integer(Types.INTEGER), "java.lang.Integer"}, + {"oid", new Integer(Oid.OID), new Integer(Types.BLOB), "java.sql.Blob"}, {"int8", new Integer(Oid.INT8), new Integer(Types.BIGINT), "java.lang.Long"}, {"money", new Integer(Oid.MONEY), new Integer(Types.DOUBLE), "java.lang.Double"}, {"numeric", new Integer(Oid.NUMERIC), new Integer(Types.NUMERIC), "java.math.BigDecimal"},

view thread (4+ messages)  latest in thread

Message-ID: <20050722135640.GM7394@emicnetworks.com>
Permalink:  ../20050722135640.GM7394@emicnetworks.com/
Also on:    postgresql.org/message-id/20050722135640.GM7394@emicnetworks.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: Marc.Herbert@emicnetworks.com
  Subject: Re: getObject(<oid>) returns integer instead of LargeObject handle ?
  In-Reply-To: <20050722135640.GM7394@emicnetworks.com>
  References: <20050722135640.GM7394@emicnetworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox