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 39661D1B440 for ; Thu, 29 Jul 2004 21:03:33 -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 26044-07 for ; Fri, 30 Jul 2004 00:03:32 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 2AF6DD1B233 for ; Thu, 29 Jul 2004 21:03:27 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BqKrv-000693-00; Fri, 30 Jul 2004 12:03:27 +1200 Message-ID: <4109904D.3090807@opencloud.com> Date: Fri, 30 Jul 2004 12:03:25 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "j.random.programmer" Cc: Kris Jurka , pgsql-jdbc@postgresql.org Subject: Re: Bug in 7.4_213 driver: returns VARCHAR instead of References: <20040729225720.15045.qmail@web14207.mail.yahoo.com> In-Reply-To: <20040729225720.15045.qmail@web14207.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/332 X-Sequence-Number: 10716 j.random.programmer wrote: > Why are the getXXXStream methods "rarely the correct > thing" ? > Ignoring current implementation artifacts (if any), > they > are almost always the _right_ thing for large amounts > of > data. The point is that it *is* all about current implementation artifacts. There's no way to stream a text value from the server on demand using the current protocol. So if you use getXXXStream() with the current driver, you always end up wrapping data that's completely on-heap anyway with an unnecessary stream interface. Note that this is more of a client/server protocol issue than a driver issue (and it's not obvious how to solve it at the protocol level anyway). As Barry said, returning LONGVARCHAR implies the preferred access method is via getXXXStream() (see the jdbc type mapping tables), but those aren't the best methods for accessing text columns in our current implementation. And the metadata should reflect the characteristics of the driver implementation actually used, surely.. -O