pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Marc Herbert <Marc.Herbert@emicnetworks.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: getObject(<oid>) returns integer instead of LargeObject
Date: Tue, 26 Jul 2005 10:42:26 +0000
Message-ID: <42E61392.8030005@opencloud.com> (raw)
In-Reply-To: <20050726102009.GB17905@emicnetworks.com>
References: <20050722135640.GM7394@emicnetworks.com>
	<Pine.BSO.4.56.0507221340260.3242@leary.csoft.net>
	<20050726102009.GB17905@emicnetworks.com>

Marc Herbert wrote:

> What would you recommend to unambiguously identify a Blob column in a
> arbitrary ResultSet, using only JDBC?

I don't think there is any way to do this in general, via JDBC or any 
other interface; you need schema-specific knowledge to work out which 
oid columns refer to LOs and which refer to a different sort of oid 
somewhere else.

The actual LO interface itself just looks like "create LO" -> "ok, 
here's an oid identifying it"; there's nothing that ties the column you 
happen to use to store that oid to the LO itself. See 
http://www.postgresql.org/docs/8.0/static/largeobjects.html for more 
details.

For comparison, contrib/vacuumlo assumes that any (non-system-generated) 
oid column in the system could potentially reference a LO (in GC-speak 
it's a conservative collector).

> PS: why do LOBs seem to use regular oids instead of some other less
> ambiguous say, "loid" ?

It's just an artifact of the implementation AFAIK.

-O



view thread (4+ messages)

Message-ID: <42E61392.8030005@opencloud.com>
Permalink:  ../42E61392.8030005@opencloud.com/
Also on:    postgresql.org/message-id/42E61392.8030005@opencloud.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: oliver@opencloud.com, Marc.Herbert@emicnetworks.com
  Subject: Re: getObject(<oid>) returns integer instead of LargeObject
  In-Reply-To: <42E61392.8030005@opencloud.com>
  References: <20050722135640.GM7394@emicnetworks.com> <Pine.BSO.4.56.0507221340260.3242@leary.csoft.net> <20050726102009.GB17905@emicnetworks.com> <42E61392.8030005@opencloud.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