BUG #1656: ResultSetMetaData.getColumnDisplaySize() returns value -1

Started by Sergio Lobalmost 21 years ago2 messagesbugs
Jump to latest
#1Sergio Lob
Sergio_Lob@iwaysoftware.com

The following bug has been logged online:

Bug reference: 1656
Logged by: Sergio Lob
Email address: sergio_lob@iwaysoftware.com
PostgreSQL version: 8.0.1
Operating system: Linux edared30 2.4.21-27.0.4.ELsmp #1 SMP Sat Apr 16
18:43:06 EDT 2005 i686 i686
Description: ResultSetMetaData.getColumnDisplaySize() returns value
-1
Details:

ResultSetMetaData.getColumnDisplaySize() returns value -1 for several
columns of answer set generated by DatabaseMetaData.getTables() method.

Columns 1,4 and 5 of answer set (columns "table_cat", "table_type", and
"remarks" respectively) are described to be of length -1. The other 2
columns of the answer set (columns 2 & 3) are described to be of length 64,
which makes more sense.

Is there a reason why -1 is returned for these columns?
Additionally, I don't understand why the data type of column 1 is described
as "OTHER", as opposed to all the other columns, which are of type "VARCHAR"
(attained through ResultSetMetaData.getColumnType() method).

Thanks, Sergio Lob

#2Kris Jurka
books@ejurka.com
In reply to: Sergio Lob (#1)
Re: BUG #1656: ResultSetMetaData.getColumnDisplaySize()

On Tue, 10 May 2005, Sergio Lob wrote:

Bug reference: 1656
PostgreSQL version: 8.0.1
Description: ResultSetMetaData.getColumnDisplaySize() returns value
-1
Details:

ResultSetMetaData.getColumnDisplaySize() returns value -1 for several
columns of answer set generated by DatabaseMetaData.getTables() method.

ResultSetMetaData.getColumnDisplaySize() returns -1 for any column that
has an unknown size. Consider the REMARKS column of getTables(). This
data comes from the system's pg_description.description column which is of
type "text". There is no defined length for this, so we have decided to
return -1.

Additionally, I don't understand why the data type of column 1 is described
as "OTHER", as opposed to all the other columns, which are of type "VARCHAR"
(attained through ResultSetMetaData.getColumnType() method).

TABLE_CAT is generated by an untyped "SELECT NULL", we should probably
cast this to name, or report the currently connected database name here.

Kris Jurka