Re: Datatype of domains not reported correctly. - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Datatype of domains not reported correctly.
Date
Msg-id alpine.BSO.2.00.0908031340110.17897@leary.csoft.net
Whole thread Raw
In response to Datatype of domains not reported correctly.  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: Datatype of domains not reported correctly.  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-jdbc

On Sat, 1 Aug 2009, Thomas Kellerer wrote:

> I noticed that the getColumns() driver dos not return the proper
> java.sql.Types value for columns that are defined through a domain.
>
> 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).

DISTINCT is the JDBC equivalent term for domains.

See Chapter 16 if the JDBC4 spec.

DISTINCT type - a user-defined type based on a built-in type; for
example: CREATE TYPE MONEY AS NUMERIC(10,2) FINAL

So I believe we're doing the right thing here, although our support for
DISTINCT elsewhere is probably lacking.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: How to retry when connection has been closed?
Next
From: Thomas Kellerer
Date:
Subject: Re: Datatype of domains not reported correctly.