DatabaseMetaData.getTypeInfo() question - Mailing list pgsql-jdbc

From Roger Bjärevall
Subject DatabaseMetaData.getTypeInfo() question
Date
Msg-id 3F851EF1.2030902@minq.se
Whole thread Raw
Responses Re: DatabaseMetaData.getTypeInfo() question
Re: DatabaseMetaData.getTypeInfo() question
List pgsql-jdbc
Hi,

We are currently testing the upcoming version of DbVisualizer with
PostgreSQL and the JDBC drivers.

We have one concern and that is the information returned from the
DatabaseMetaData.getTypeInfo() method.

It returns a lots of information, some are data type info while some
are tables or functions(?).

We did a quick comparision of the supported data types as listed in the
PostgreSQL documenation and what is returned by the getTypeInfo call.
The result is rather confusing for us.

(http://www.postgresql.org/docs/7.3/static/datatype.html)

- Among the real data types we find types such as:

   TYPE_NAME    DATA_TYPE    PRECISION
   pg_cast    1111        9
   pg_class    1111        9
   pg_constraint    1111        9
   pg_conversion    1111        9
   pg_database    1111        9

   What is this and why do they appear when getting type info?

- The documentation lists data types as "Type Name" and "Aliases".
   Why do the getTypeInfo() call return the aliased name for almost
   all data types that have an alias instead of the in most cases
   preferred "Type Name"?
   I.e we believe that users coming from other databases would prefeer
   "bigint" rather then "int8", "smallint" rathern then "int2", etc.
   There are some exceptions to this such as the "varchar" alias which
   is more common then "character varying".

   One solution is simply to add the real type names to the existing list
   of data types as returned by the getTypeInfo() call.

Any feedback is appreciated.

Roger Bjärevall
Minq Software







--
Roger Bjärevall
Product Manager

Minq Software AB
Stockholm, Sweden
Phone:  +46 8 55602760
Fax:    +46 8 55602777
roger.bjarevall@minq.se
http://www.minq.se


pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: Problem with bytea getBytes and setBytes
Next
From: Nicola Pero
Date:
Subject: Using JDBC and libpq in the same process