BUG #1628: JDBC bug with regard to text column data type - Mailing list pgsql-bugs

From Nathan Neuenschwander
Subject BUG #1628: JDBC bug with regard to text column data type
Date
Msg-id 20050426190654.72BA9F107F@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #1628: JDBC bug with regard to text column data type
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1628
Logged by:          Nathan Neuenschwander
Email address:      nathan_neuenschwander@comcast.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.

pgsql-bugs by date:

Previous
From: "deepak"
Date:
Subject: BUG #1633: about transactions and row level locking
Next
From: Achilleus Mantzios
Date:
Subject: Re: BUG #1632: Several jailed PostgreSQL instances.