pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedBug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types
6+ messages / 4 participants
[nested] [flat]
* Bug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types
@ 2004-07-27 08:45 j.random.programmer <javadesigner@yahoo.com>
2004-07-29 21:33 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 6+ messages in thread
From: j.random.programmer @ 2004-07-27 08:45 UTC (permalink / raw)
To: pgsql-jdbc
The JDBC version 7.4_213 driver has the following bug
For database SQL type:
text (that is variable unlimited length)
The JDBC driver returns "java.sql.VARCHAR" as
the column type. (via database meta data).
This is wrong. The JDBC driver SHOULD return
java.sql.LONGVARCHAR (since the text type is
of unlimited length).
Please fix this because it is messing up my
relational mapping code.
Best regards,
--j
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Bug in 7.4_213 driver: returns VARCHAR instead of
2004-07-27 08:45 Bug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types j.random.programmer <javadesigner@yahoo.com>
@ 2004-07-29 21:33 ` Kris Jurka <books@ejurka.com>
2004-07-29 21:54 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Jurka @ 2004-07-29 21:33 UTC (permalink / raw)
To: j.random.programmer <javadesigner@yahoo.com>; +Cc: pgsql-jdbc
On Tue, 27 Jul 2004, j.random.programmer wrote:
> The JDBC version 7.4_213 driver has the following bug
>
> For database SQL type:
> text (that is variable unlimited length)
>
> The JDBC driver returns "java.sql.VARCHAR" as
> the column type. (via database meta data).
>
> This is wrong. The JDBC driver SHOULD return
> java.sql.LONGVARCHAR (since the text type is
> of unlimited length).
>
I'm not sure this is clearly wrong, but you do make a convincing argument.
My concern is backwards compatibility with existing applications that
expect text as VARCHAR. When I tried the change in the driver, there were
4 failures and 2 errors in the drivers regression test. Some code didn't
handle LONGVARCHAR at all and others expected text to be VARCHAR.
For example consider CallableStatements:
CallableStatement call = con.prepareCall ("{ ? = upper(?) }");
call.setString(2, "foo");
call.registerOutParameter(1, Types.VARCHAR);
call.execute();
String result = call.getString(1); // Should be "FOO"
With the proposed change this will fail because the output type of upper
is text and it's no longer mapped to Types.VARCHAR, but LONGVARCHAR, so
you'll get this exception:
A CallableStatement Function was executed and the return was of type
(java.sql.Types=-1) however type=java.sql.Types=12 was registered.
Kris Jurka
Attachments:
text.patch (text/plain, 11.3K) download
? org/postgresql/jdbc2/.AbstractJdbc2Statement.java.swp
? org/postgresql/test/jdbc2/.ArrayTest.java.swp
Index: org/postgresql/jdbc2/AbstractJdbc2Array.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Array.java,v
retrieving revision 1.1
diff -c -r1.1 AbstractJdbc2Array.java
*** org/postgresql/jdbc2/AbstractJdbc2Array.java 16 Jul 2004 09:07:56 -0000 1.1
--- org/postgresql/jdbc2/AbstractJdbc2Array.java 29 Jul 2004 21:16:41 -0000
***************
*** 165,170 ****
--- 165,171 ----
break;
case Types.CHAR:
case Types.VARCHAR:
+ case Types.LONGVARCHAR:
retVal = new String[ count ];
for ( ; count > 0; count-- )
((String[])retVal)[i++] = arrayContents[(int)index++];
***************
*** 297,308 ****
rows.addElement(tuple);
}
break;
case Types.CHAR:
fields[1] = new Field("VALUE", Oid.CHAR, 1);
case Types.VARCHAR:
String[] strArray = (String[]) array;
- if ( fields[1] == null )
- fields[1] = new Field("VALUE", Oid.VARCHAR, -1);
for ( int i = 0; i < strArray.length; i++ )
{
byte[][] tuple = new byte[2][0];
--- 298,315 ----
rows.addElement(tuple);
}
break;
+
case Types.CHAR:
fields[1] = new Field("VALUE", Oid.CHAR, 1);
case Types.VARCHAR:
+ fields[1] = new Field("VALUE", Oid.VARCHAR, -1);
+ case Types.LONGVARCHAR:
+ fields[1] = new Field("VALUE", Oid.TEXT, -1);
+
+ // Everything falls through from above.
+ //
+
String[] strArray = (String[]) array;
for ( int i = 0; i < strArray.length; i++ )
{
byte[][] tuple = new byte[2][0];
Index: org/postgresql/jdbc2/AbstractJdbc2Connection.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java,v
retrieving revision 1.14
diff -c -r1.14 AbstractJdbc2Connection.java
*** org/postgresql/jdbc2/AbstractJdbc2Connection.java 27 Jul 2004 05:19:33 -0000 1.14
--- org/postgresql/jdbc2/AbstractJdbc2Connection.java 29 Jul 2004 21:16:41 -0000
***************
*** 1061,1067 ****
"float4",
"float8",
"bpchar", "char", "char2", "char4", "char8", "char16",
! "varchar", "text", "name", "filename",
"bytea",
"bool",
"bit",
--- 1061,1068 ----
"float4",
"float8",
"bpchar", "char", "char2", "char4", "char8", "char16",
! "varchar", "name", "filename",
! "text",
"bytea",
"bool",
"bit",
***************
*** 1090,1096 ****
Types.REAL,
Types.DOUBLE,
Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR,
! Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
Types.BINARY,
Types.BIT,
Types.BIT,
--- 1091,1098 ----
Types.REAL,
Types.DOUBLE,
Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR,
! Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
! Types.LONGVARCHAR,
Types.BINARY,
Types.BIT,
Types.BIT,
Index: org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v
retrieving revision 1.44
diff -c -r1.44 AbstractJdbc2ResultSet.java
*** org/postgresql/jdbc2/AbstractJdbc2ResultSet.java 27 Jul 2004 05:19:33 -0000 1.44
--- org/postgresql/jdbc2/AbstractJdbc2ResultSet.java 29 Jul 2004 21:16:41 -0000
***************
*** 133,138 ****
--- 133,139 ----
return new Double(getDouble(columnIndex));
case Types.CHAR:
case Types.VARCHAR:
+ case Types.LONGVARCHAR:
return getString(columnIndex);
case Types.DATE:
return getDate(columnIndex);
***************
*** 142,147 ****
--- 143,149 ----
return getTimestamp(columnIndex);
case Types.BINARY:
case Types.VARBINARY:
+ case Types.LONGVARBINARY:
return getBytes(columnIndex);
case Types.ARRAY:
return getArray(columnIndex);
***************
*** 1668,1673 ****
--- 1670,1676 ----
case Types.DOUBLE:
case Types.BIT:
case Types.VARCHAR:
+ case Types.LONGVARCHAR:
case Types.DATE:
case Types.TIME:
case Types.TIMESTAMP:
Index: org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java,v
retrieving revision 1.10
diff -c -r1.10 AbstractJdbc2ResultSetMetaData.java
*** org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java 29 Jul 2004 19:34:05 -0000 1.10
--- org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java 29 Jul 2004 21:16:41 -0000
***************
*** 349,356 ****
return 16;
case Types.DOUBLE:
return 16;
- case Types.VARCHAR:
- return 0;
case Types.NUMERIC:
Field f = getField(column);
if (f != null) {
--- 349,354 ----
***************
*** 391,398 ****
return 16;
case Types.DOUBLE:
return 16;
- case Types.VARCHAR:
- return 0;
case Types.NUMERIC:
Field f = getField(column);
if (f != null) {
--- 389,394 ----
***************
*** 609,614 ****
--- 605,611 ----
switch (sql_type)
{
+ case Types.BOOLEAN:
case Types.BIT:
return ("java.lang.Boolean");
case Types.SMALLINT:
***************
*** 625,630 ****
--- 622,628 ----
return ("java.lang.Double");
case Types.CHAR:
case Types.VARCHAR:
+ case Types.LONGVARCHAR:
return ("java.lang.String");
case Types.DATE:
return ("java.sql.Date");
***************
*** 634,639 ****
--- 632,642 ----
return ("java.sql.Timestamp");
case Types.BINARY:
case Types.VARBINARY:
+ case Types.LONGVARBINARY:
+ // this is the result of
+ // (new byte[0]).getClass().getName()
+ // although it is kind of useless because it
+ // can't be used in Class.forName()
return ("[B");
case Types.ARRAY:
return ("java.sql.Array");
Index: org/postgresql/jdbc3/AbstractJdbc3Connection.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc3/AbstractJdbc3Connection.java,v
retrieving revision 1.7
diff -c -r1.7 AbstractJdbc3Connection.java
*** org/postgresql/jdbc3/AbstractJdbc3Connection.java 9 Jul 2004 23:50:28 -0000 1.7
--- org/postgresql/jdbc3/AbstractJdbc3Connection.java 29 Jul 2004 21:16:43 -0000
***************
*** 430,436 ****
"float4",
"float8",
"bpchar", "char", "char2", "char4", "char8", "char16",
! "varchar", "text", "name", "filename",
"bytea",
"bool",
"bit",
--- 430,437 ----
"float4",
"float8",
"bpchar", "char", "char2", "char4", "char8", "char16",
! "varchar", "name", "filename",
! "text",
"bytea",
"bool",
"bit",
***************
*** 459,465 ****
Types.REAL,
Types.DOUBLE,
Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR,
! Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
Types.BINARY,
Types.BIT,
Types.BIT,
--- 460,467 ----
Types.REAL,
Types.DOUBLE,
Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR,
! Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
! Types.LONGVARCHAR,
Types.BINARY,
Types.BIT,
Types.BIT,
Index: org/postgresql/test/jdbc2/ArrayTest.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/ArrayTest.java,v
retrieving revision 1.2
diff -c -r1.2 ArrayTest.java
*** org/postgresql/test/jdbc2/ArrayTest.java 20 Jul 2004 00:24:37 -0000 1.2
--- org/postgresql/test/jdbc2/ArrayTest.java 29 Jul 2004 21:16:43 -0000
***************
*** 54,60 ****
assertEquals(new BigDecimal("1.4"), decarr[1]);
arr = rs.getArray(3);
! assertEquals(Types.VARCHAR, arr.getBaseType());
String strarr[] = (String[])arr.getArray(2,2);
assertEquals(2,strarr.length);
assertEquals("f'a", strarr[0]);
--- 54,60 ----
assertEquals(new BigDecimal("1.4"), decarr[1]);
arr = rs.getArray(3);
! assertEquals(Types.LONGVARCHAR, arr.getBaseType());
String strarr[] = (String[])arr.getArray(2,2);
assertEquals(2,strarr.length);
assertEquals("f'a", strarr[0]);
***************
*** 98,104 ****
arrrs.close();
arr = rs.getArray(3);
! assertEquals(Types.VARCHAR, arr.getBaseType());
arrrs = arr.getResultSet(2,2);
assertTrue(arrrs.next());
assertEquals(2, arrrs.getInt(1));
--- 98,104 ----
arrrs.close();
arr = rs.getArray(3);
! assertEquals(Types.LONGVARCHAR, arr.getBaseType());
arrrs = arr.getResultSet(2,2);
assertTrue(arrrs.next());
assertEquals(2, arrrs.getInt(1));
Index: org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java,v
retrieving revision 1.25
diff -c -r1.25 DatabaseMetaDataTest.java
*** org/postgresql/test/jdbc2/DatabaseMetaDataTest.java 29 Jun 2004 06:43:28 -0000 1.25
--- org/postgresql/test/jdbc2/DatabaseMetaDataTest.java 29 Jul 2004 21:16:43 -0000
***************
*** 68,74 ****
assertTrue( rs.next() );
assertEquals( "testmetadata", rs.getString("TABLE_NAME") );
assertEquals( "name", rs.getString("COLUMN_NAME") );
! assertEquals( java.sql.Types.VARCHAR, rs.getInt("DATA_TYPE") );
assertTrue( rs.next() );
assertEquals( "testmetadata", rs.getString("TABLE_NAME") );
--- 68,74 ----
assertTrue( rs.next() );
assertEquals( "testmetadata", rs.getString("TABLE_NAME") );
assertEquals( "name", rs.getString("COLUMN_NAME") );
! assertEquals( java.sql.Types.LONGVARCHAR, rs.getInt("DATA_TYPE") );
assertTrue( rs.next() );
assertEquals( "testmetadata", rs.getString("TABLE_NAME") );
Index: org/postgresql/test/jdbc2/ResultSetMetaDataTest.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/ResultSetMetaDataTest.java,v
retrieving revision 1.2
diff -c -r1.2 ResultSetMetaDataTest.java
*** org/postgresql/test/jdbc2/ResultSetMetaDataTest.java 9 Jul 2004 23:50:32 -0000 1.2
--- org/postgresql/test/jdbc2/ResultSetMetaDataTest.java 29 Jul 2004 21:16:43 -0000
***************
*** 63,70 ****
}
public void testGetColumnType() throws SQLException {
! assertEquals(rsmd.getColumnType(1), Types.INTEGER);
! assertEquals(rsmd.getColumnType(2), Types.VARCHAR);
}
public void testGetColumnTypeName() throws SQLException {
--- 63,70 ----
}
public void testGetColumnType() throws SQLException {
! assertEquals(Types.INTEGER, rsmd.getColumnType(1));
! assertEquals(Types.LONGVARCHAR, rsmd.getColumnType(2));
}
public void testGetColumnTypeName() throws SQLException {
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Bug in 7.4_213 driver: returns VARCHAR instead of
2004-07-27 08:45 Bug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types j.random.programmer <javadesigner@yahoo.com>
2004-07-29 21:33 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
@ 2004-07-29 21:54 ` Kris Jurka <books@ejurka.com>
2004-07-29 22:20 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Barry Lind <blind@xythos.com>
2004-07-29 22:57 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of j.random.programmer <javadesigner@yahoo.com>
0 siblings, 2 replies; 6+ messages in thread
From: Kris Jurka @ 2004-07-29 21:54 UTC (permalink / raw)
To: j.random.programmer <javadesigner@yahoo.com>; +Cc: pgsql-jdbc
On Thu, 29 Jul 2004, Kris Jurka wrote:
> On Tue, 27 Jul 2004, j.random.programmer wrote:
>
> > The JDBC version 7.4_213 driver has the following bug
> >
> > For database SQL type:
> > text (that is variable unlimited length)
> >
> > The JDBC driver returns "java.sql.VARCHAR" as
> > the column type. (via database meta data).
> >
> > This is wrong. The JDBC driver SHOULD return
> > java.sql.LONGVARCHAR (since the text type is
> > of unlimited length).
> >
>
> I'm not sure this is clearly wrong, but you do make a convincing argument.
I'm not so sure anymore. While text can be used for storing large values
it often isn't. Further returning LONGVARCHAR could be a sign for the
caller to use something like ResultSet.getCharacterStream instead of a
simple getString.
Kris Jurka
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Bug in 7.4_213 driver: returns VARCHAR instead of
2004-07-27 08:45 Bug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types j.random.programmer <javadesigner@yahoo.com>
2004-07-29 21:33 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
2004-07-29 21:54 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
@ 2004-07-29 22:20 ` Barry Lind <blind@xythos.com>
1 sibling, 0 replies; 6+ messages in thread
From: Barry Lind @ 2004-07-29 22:20 UTC (permalink / raw)
To: Kris Jurka <books@ejurka.com>; +Cc: j.random.programmer <javadesigner@yahoo.com>; pgsql-jdbc
Kris Jurka wrote:
> I'm not so sure anymore. While text can be used for storing large values
> it often isn't. Further returning LONGVARCHAR could be a sign for the
> caller to use something like ResultSet.getCharacterStream instead of a
> simple getString.
I would agree. In our applications we exclusively use text everywhere
we use varchar on other databases. I am quite sure that a change like
this would break peoples existing apps. I also agree that LONGVARCHAR
would imply that you should use the getXXXStream methods which I would
say is rarely the correct thing to do. In my opinion text is just a
better version of varchar (without many of the limitations imposed on
varchar in other database vendor implementations).
--Barry
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Bug in 7.4_213 driver: returns VARCHAR instead of
2004-07-27 08:45 Bug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types j.random.programmer <javadesigner@yahoo.com>
2004-07-29 21:33 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
2004-07-29 21:54 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
@ 2004-07-29 22:57 ` j.random.programmer <javadesigner@yahoo.com>
2004-07-30 00:03 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Oliver Jowett <oliver@opencloud.com>
1 sibling, 1 reply; 6+ messages in thread
From: j.random.programmer @ 2004-07-29 22:57 UTC (permalink / raw)
To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc
Kris:
Firstly, let me say that I, as a end-user, really
appreciate
the time you and others take to reply to posts and
work
on the JDBC driver.
postgresql/jdbc has pretty much become my reference
system
these days and it's no small part due to the sense of
community
one feels in these parts.
> > The JDBC driver returns "java.sql.VARCHAR" as for
"text" but
> > SHOULD return java.sql.LONGVARCHAR (since the text
type is of
> > unlimited length).
>
> My concern is backwards compatibility with existing
> applications that expect text as VARCHAR. When I
tried the
> change in the driver, there were 4 failures and 2
errors in
> the drivers regression test. Some code didn't
handle
> LONGVARCHAR at all and others expected text to be
VARCHAR.
But it's always better to do the right thing, isn't it
?
Both the intuitive expectation and the JDBC spec imply
that LONGVARCHAR is the right thing in this case.
Sure, I've
worked around this particular bug in one case (I check
to
see if the max column size = -1 and if so, internally
flip
the type to LONGVARCHAR and return a
reader/inputstream if
the user wants and also ignore setting up size
validation).
> For example consider CallableStatements:
> ...
> A CallableStatement Function was executed and the
return was
> of type (java.sql.Types=-1) however
type=java.sql.Types=12 was
> registered.
I don't understand the full implications of your
CallableStatement (CallableStatement is the one part
of
JDBC I haven't had reason to use).
Is this a unfixable problem though ? Also, isn't it
good that
you are getting some problems in the regression tests,
that means
there are some hidden bugs that just got exposed and
might as
well now get fixed.
> I'm not so sure anymore. While text can be used for
storing
> large values it often isn't. Further returning
LONGVARCHAR
> could be a sign for the caller to use something like
> ResultSet.getCharacterStream instead of a simple
getString.
The whole point of using streams is that large strings
may not fit in memory [for multiple users, all those
large strings definitely _won't_ fit in memory]. Of
course
this may be moot in the _current_ driver
implementation
(which for all I know might horking the whole string
from
the database into memory and then returing a
StringReader
or whatever).
But the right thing for large amounts of data again is
streams,
not storing that data in memory.
> In our applications we exclusively use text
everywhere we use
> varchar on other databases. I am quite sure that a
change
> like this would break peoples existing apps. I also
agree
> that LONGVARCHAR would imply that you should use the
> getXXXStream methods which I would say is rarely the
correct
> thing to do.
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.
Or am I missing something here ?
Best regards,
--j
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Bug in 7.4_213 driver: returns VARCHAR instead of
2004-07-27 08:45 Bug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types j.random.programmer <javadesigner@yahoo.com>
2004-07-29 21:33 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
2004-07-29 21:54 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
2004-07-29 22:57 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of j.random.programmer <javadesigner@yahoo.com>
@ 2004-07-30 00:03 ` Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 6+ messages in thread
From: Oliver Jowett @ 2004-07-30 00:03 UTC (permalink / raw)
To: j.random.programmer <javadesigner@yahoo.com>; +Cc: Kris Jurka <books@ejurka.com>; 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
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2004-07-30 00:03 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-27 08:45 Bug in 7.4_213 driver: returns VARCHAR instead of LONGVARCHAR for text types j.random.programmer <javadesigner@yahoo.com>
2004-07-29 21:33 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
2004-07-29 21:54 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Kris Jurka <books@ejurka.com>
2004-07-29 22:20 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Barry Lind <blind@xythos.com>
2004-07-29 22:57 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of j.random.programmer <javadesigner@yahoo.com>
2004-07-30 00:03 ` Re: Bug in 7.4_213 driver: returns VARCHAR instead of Oliver Jowett <oliver@opencloud.com>
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