DatabaseMetaData.getTypeInfo() question

From: Roger Bjärevall <roger(at)minq(dot)se>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: DatabaseMetaData.getTypeInfo() question
Date: 2003-10-09 08:40:17
Message-ID: 3F851EF1.2030902@minq.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)bjarevall(at)minq(dot)se
http://www.minq.se

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nicola Pero 2003-10-09 11:30:24 Using JDBC and libpq in the same process
Previous Message Xavier Poinsard 2003-10-09 07:37:03 Re: Problem with bytea getBytes and setBytes