pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marek Lewczuk <newsy@lewczuk.com>
To: pgsql-jdbc <pgsql-jdbc@postgresql.org>
To: Kris Jurka <books@ejurka.com>
Subject: ResultSetMetaData getColumnTypeName()
Date: Wed, 21 Nov 2007 09:07:00 +0100
Message-ID: <4743E724.60608@lewczuk.com> (raw)

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





view thread (3+ messages)  latest in thread

Message-ID: <4743E724.60608@lewczuk.com>
Permalink:  ../4743E724.60608@lewczuk.com/
Also on:    postgresql.org/message-id/4743E724.60608@lewczuk.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: newsy@lewczuk.com, books@ejurka.com
  Subject: Re: ResultSetMetaData getColumnTypeName()
  In-Reply-To: <4743E724.60608@lewczuk.com>
  References: <4743E724.60608@lewczuk.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox