Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 16AB5634883 for ; Mon, 3 Aug 2009 14:44:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 51120-02 for ; Mon, 3 Aug 2009 17:44:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 95AC56344CB for ; Mon, 3 Aug 2009 14:44:28 -0300 (ADT) Received: by leary.csoft.net (Postfix, from userid 1112) id E95B3A2FD; Mon, 3 Aug 2009 13:44:26 -0400 (EDT) Date: Mon, 3 Aug 2009 13:44:26 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Thomas Kellerer cc: pgsql-jdbc@postgresql.org Subject: Re: Datatype of domains not reported correctly. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/4 X-Sequence-Number: 19853 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