Re: getObject() returns integer instead of LargeObject - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: getObject() returns integer instead of LargeObject
Date
Msg-id 42E61392.8030005@opencloud.com
Whole thread Raw
In response to Re: getObject() returns integer instead of LargeObject  (Marc Herbert <Marc.Herbert@emicnetworks.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: work in progress: timestamp patch
Next
From: Dave Cramer
Date:
Subject: Re: work in progress: timestamp patch