Datatype of domains not reported correctly.

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Datatype of domains not reported correctly.
Date: 2009-08-01 20:53:59
Message-ID: h52a14$kgg$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I noticed that the getColumns() driver dos not return the proper java.sql.Types value for columns
that are defined through a domain.

I was looking at the pagila sample database. The table film contains the column release_year which
is defined as year. The domain year is defined as

CREATE DOMAIN year AS integer
CONSTRAINT year_check CHECK (((VALUE >= 1901) AND (VALUE <= 2155)));

When using getColumns() the driver returns the value 2001 for DATA_TYPE (which is
java.sql.Types.DISTINCT).

Maybe I'm missing something, but I would have expected the driver to return the numeric value for
the underlying datatype (java.sql.Types.INTEGER in this case).
Or at least java.sql.Types.OTHER (the way it's done for enums)

Regards
Thomas

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Herouth Maoz 2009-08-02 09:12:55 How to retry when connection has been closed?
Previous Message Ben Weber 2009-07-30 22:54:42 unnecessary exception patch