Re: Bug in 7.4_213 driver: returns VARCHAR instead of

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: "j(dot)random(dot)programmer" <javadesigner(at)yahoo(dot)com>
Cc: Kris Jurka <books(at)ejurka(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bug in 7.4_213 driver: returns VARCHAR instead of
Date: 2004-07-30 00:03:25
Message-ID: 4109904D.3090807@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nick Selva 2004-07-30 04:18:23 Calling PGSQL Stored function thru JDBC
Previous Message j.random.programmer 2004-07-29 22:57:20 Re: Bug in 7.4_213 driver: returns VARCHAR instead of