On Wed, 25 Feb 2009, DGPickett wrote:
> Selecting a constant string or concatenated columns from postgres
> using jisql (xigole), I get heap overflow.
> select 'X' AS XXX from . . . .
While in this case it's obvious that 'X' has length 1, the server isn't
telling the driver that. Even if it did in this case, there are clearly
cases the server cannot know the output length. Consider:
SELECT repeat('X', (random() * 100)::int);
So regardless of the simple case you've shown, we must be able to handle
unknown length data. Previously we did that by returning -1 which broke
the rowset implementation which insisted that the value by >= 0. So we
moved to Integer.MAX_VALUE which seems to mostly work for people.
This thread details how we intend to solve the similar problem of
getPrecision for Crystal Reports users, so we could likely apply the same
sort of changes for display size as well.
> This discussion seems to say this is a postgres JDBC bug:
That's not how I read the discussion. The thread says that h2 does the
same thing and that the author has provided a workaround to allow the user
to provide a custom formatter to handle data types with problems.
In response to
pgsql-jdbc by date
|Next:||From: DGPickett||Date: 2009-02-26 16:54:11|
|Subject: Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?|
|Previous:||From: Jesus Maudes||Date: 2009-02-26 00:05:22|
|Subject: Early JDBC driver load?|