ResultSetMetaData getColumnTypeName()

From: Marek Lewczuk <newsy(at)lewczuk(dot)com>
To: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>, Kris Jurka <books(at)ejurka(dot)com>
Subject: ResultSetMetaData getColumnTypeName()
Date: 2007-11-21 08:07:00
Message-ID: 4743E724.60608@lewczuk.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,
I would like to discuss an issue ResultSetMetaData.getColumnTypeName().
Within current implementation of PostgreSQL JDBC getColumnTypeName()
returns only locale name of a type, even if it is a user-defined type.
The JDBC docs says:
"...returns type name used by the database. If the column type is a
user-defined type, then a fully-qualified type name is returned."

It means, that any other type that is not defined within pg_catalog
should be returned with its schema name, so e.g. type my_price in schema
blabla should be returned as "blabla.my_price". It's quite simple to fix
it and I'm ready to do it, but before that I would like to ask about
your opinion about changing this behavior. I found this problem when I
needed to translate user-defined types to Java and without schema I
cannot be sure, that a type is the one that I want to translate (cause
there can be many types with the same local name).

I would be appreciated for your comments.

Ps. Kris - if we will accept, that getColumnTypeName() should return
qualified name, then that will cause small changes within
org.postgresql.jdbc2.TypeInfoCache class and I would like to know what
about my previous changes within this class that are related to array types.

Best wishes,
Marek

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Garber, Mikhail 2007-11-21 16:25:53 Recommendations for Java XA toolkit to use with Postgresql
Previous Message Kris Jurka 2007-11-20 21:37:36 Re: NULL values in arrays