X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A180652B80 for ; Tue, 26 Jul 2005 07:42:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67057-10 for ; Tue, 26 Jul 2005 10:42:27 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id D815D52BDC for ; Tue, 26 Jul 2005 07:42:24 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.21]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DxMtG-00034x-RZ; Tue, 26 Jul 2005 22:42:26 +1200 Message-ID: <42E61392.8030005@opencloud.com> Date: Tue, 26 Jul 2005 10:42:26 +0000 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marc Herbert Cc: pgsql-jdbc@postgresql.org Subject: Re: getObject() returns integer instead of LargeObject References: <20050722135640.GM7394@emicnetworks.com> <20050726102009.GB17905@emicnetworks.com> In-Reply-To: <20050726102009.GB17905@emicnetworks.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/320 X-Sequence-Number: 13468 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