BUG #1628: JDBC bug with regard to text column data type

From: "Nathan Neuenschwander" <nathan_neuenschwander(at)comcast(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1628: JDBC bug with regard to text column data type
Date: 2005-04-26 19:06:54
Message-ID: 20050426190654.72BA9F107F@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1628
Logged by: Nathan Neuenschwander
Email address: nathan_neuenschwander(at)comcast(dot)net
PostgreSQL version: 8.0
Operating system: Win XP
Description: JDBC bug with regard to text column data type
Details:

I am using a CachedRowSet, the JDBC driver for PG 8.0, and j2ee.
If the target table contains a column of data type text, the following
causes an SQLException with a message stating that a negative value was
returned for the column display size. If the text column is changed to a
varchar, the exception is not triggered. The exception is not dependent upon
the particular column being queried, just the enclosing table. (The proper
variable init is implied.)

SQL
# Create column with text data type.
Create Table table_a(field1 Integer, field2 text);

// Java
cachedrowset.setCommand("Select field2 from table_a");
cachedrowset.execute(connection); // Results in Exception.

SQL
# Create column with varchar data type.
Create Table table_b(field1 Integer, field2 varchar(100));

// Java
cachedrowset.setCommand("Select field2 from table_b");
cachedrowset.execute(connection); // No Exception.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message mike g 2005-04-26 20:23:50 BUG #1629: subquery IN returns incorrect results
Previous Message John Danger 2005-04-26 13:50:41 BUG #1627: Fails to compile