pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: j.random.programmer <javadesigner@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: Meta Information about columns of a domain datatype ?
Date: Fri, 16 Jun 2006 00:54:55 -0700 (PDT)
Message-ID: <20060616075455.37486.qmail@web32012.mail.mud.yahoo.com> (raw)
In-Reply-To: <43A74230.8030706@opencloud.com>

Hi:

I am using the LATEST postgres 8 JDBC driver against 
PostgresQL 8.1.x.

I have a O/R mapping tool that uses JDBC meta data to
generate Java
code. When using tables with a column whose datatype
is a domain,
the driver returns a typecode of 1111 (other).

Is there anyway to get information about the domain ?

I've tried
a) calling DataBaseMetaData.getAttributes(..)  but
it's not implemented.
b) DataBaseMetaData.getUDTs(...) is not helpful
either.

A similar question was posted on this list about 18
months ago.

     * Subject: meta data information returned for
domains
     * Date: Fri, 3 Dec 2004 12:13:13 +0900

However, there wasn't a resolution then. 

Is this problem solved/fixable ? Any suggestions ?

Here is the specific SQL.
--------------------------------------------------------
CREATE DOMAIN sex AS CHARACTER(1) CHECK (VALUE in
('m', 'f'));

CREATE TABLE subject (
    subject_id SERIAL CONSTRAINT NN_subject_id NOT
NULL,
    fname CHARACTER VARYING(99),
    lname CHARACTER VARYING(99) CONSTRAINT NN_lname
NOT NULL,
    dob DATE,
    sex sex CONSTRAINT NN_sex NOT NULL,
    CONSTRAINT PK_subject PRIMARY KEY (subject_id)
);
------------------------------------------------------

It all breaks for the 'sex' column. (and no, not using
domains is
not an option since the actual database is very very
complex).

:-)

Best regards,
--j



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



view thread (5+ messages)  latest in thread

Message-ID: <20060616075455.37486.qmail@web32012.mail.mud.yahoo.com>
Permalink:  ../20060616075455.37486.qmail@web32012.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20060616075455.37486.qmail@web32012.mail.mud.yahoo.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: javadesigner@yahoo.com
  Subject: Re: Meta Information about columns of a domain datatype ?
  In-Reply-To: <20060616075455.37486.qmail@web32012.mail.mud.yahoo.com>
  References: <43A74230.8030706@opencloud.com> <20060616075455.37486.qmail@web32012.mail.mud.yahoo.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