pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Meta Information about columns of a domain datatype ?
5+ messages / 3 participants
[nested] [flat]

* Meta Information about columns of a domain datatype ?
@ 2006-06-16 07:54 j.random.programmer <javadesigner@yahoo.com>
  2006-06-18 06:03 ` Re: Meta Information about columns of a domain datatype ? Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 5+ messages in thread

From: j.random.programmer @ 2006-06-16 07:54 UTC (permalink / raw)
  To: pgsql-jdbc

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 



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Meta Information about columns of a domain datatype ?
  2006-06-16 07:54 Meta Information about columns of a domain datatype ? j.random.programmer <javadesigner@yahoo.com>
@ 2006-06-18 06:03 ` Oliver Jowett <oliver@opencloud.com>
  2006-06-19 13:57   ` Re: Meta Information about columns of a domain datatype ? Kris Jurka <books@ejurka.com>
  2006-06-19 17:38   ` Re: Meta Information about columns of a domain datatype ? j.random.programmer <javadesigner@yahoo.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Oliver Jowett @ 2006-06-18 06:03 UTC (permalink / raw)
  To: j.random.programmer <javadesigner@yahoo.com>; +Cc: pgsql-jdbc

j.random.programmer wrote:

>      * Subject: meta data information returned for
> domains
>      * Date: Fri, 3 Dec 2004 12:13:13 +0900
> 
> However, there wasn't a resolution then. 

I couldn't find this in the archives. Do you have a link?

How would you expect domain info to be returned via the metadata interfaces?

-O



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Meta Information about columns of a domain datatype ?
  2006-06-16 07:54 Meta Information about columns of a domain datatype ? j.random.programmer <javadesigner@yahoo.com>
  2006-06-18 06:03 ` Re: Meta Information about columns of a domain datatype ? Oliver Jowett <oliver@opencloud.com>
@ 2006-06-19 13:57   ` Kris Jurka <books@ejurka.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Kris Jurka @ 2006-06-19 13:57 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: j.random.programmer <javadesigner@yahoo.com>; pgsql-jdbc



On Sun, 18 Jun 2006, Oliver Jowett wrote:

> j.random.programmer wrote:
>
>>      * Subject: meta data information returned for
>> domains
>>      * Date: Fri, 3 Dec 2004 12:13:13 +0900
>> 
>> However, there wasn't a resolution then. 
>
> I couldn't find this in the archives. Do you have a link?
>
> How would you expect domain info to be returned via the metadata interfaces?
>

I vaguely recall a discussion of this suggesting the base type of a domain 
should be returned in the SOURCE_DATA_TYPE column of 
DatabaseMetaData.getColumns.  This column was added in JDBC3 and we 
currently only support the JDBC2 columns.

http://java.sun.com/j2se/1.5.0/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,%...)

Kris Jurka




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Meta Information about columns of a domain datatype ?
  2006-06-16 07:54 Meta Information about columns of a domain datatype ? j.random.programmer <javadesigner@yahoo.com>
  2006-06-18 06:03 ` Re: Meta Information about columns of a domain datatype ? Oliver Jowett <oliver@opencloud.com>
@ 2006-06-19 17:38   ` j.random.programmer <javadesigner@yahoo.com>
  2006-06-19 22:12     ` Re: Meta Information about columns of a domain datatype ? Oliver Jowett <oliver@opencloud.com>
  1 sibling, 1 reply; 5+ messages in thread

From: j.random.programmer @ 2006-06-19 17:38 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc

 > I couldn't find this in the archives. Do you have a
> link?

Here it is:

http://archives.postgresql.org/pgsql-jdbc/2004-12/msg00008.php


> How would you expect domain info to be returned via
> the metadata interfaces?

I don't know :-)

You and Kris figure it out.  

:-) 

But it's not a show-stopper if it's too hard to do.

I worked around this by telling Datanamic Dezign (my
modelling tool) to not write out the domain
information seperately and if a column
uses a domain, then create that column with the
underlying
type that the domain uses (as opposed to the domain
itself).

Best regards,
--j

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Meta Information about columns of a domain datatype ?
  2006-06-16 07:54 Meta Information about columns of a domain datatype ? j.random.programmer <javadesigner@yahoo.com>
  2006-06-18 06:03 ` Re: Meta Information about columns of a domain datatype ? Oliver Jowett <oliver@opencloud.com>
  2006-06-19 17:38   ` Re: Meta Information about columns of a domain datatype ? j.random.programmer <javadesigner@yahoo.com>
@ 2006-06-19 22:12     ` Oliver Jowett <oliver@opencloud.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Oliver Jowett @ 2006-06-19 22:12 UTC (permalink / raw)
  To: j.random.programmer <javadesigner@yahoo.com>; +Cc: pgsql-jdbc

j.random.programmer wrote:

>> How would you expect domain info to be returned via
>> the metadata interfaces?
> 
> I don't know :-)
> 
> You and Kris figure it out.  

Well, without knowing what information you actually want to extract 
about the type it's a bit pointless taking this further. Is 
SOURCE_DATA_TYPE sufficient? How is whatever-data-it-is-that-you-need 
returned by other DB drivers?

(I am not going to have time to actually do any implementation of this, 
I'm just trying to get enough information for someone else to consider 
implementing it)

-O



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2006-06-19 22:12 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-16 07:54 Meta Information about columns of a domain datatype ? j.random.programmer <javadesigner@yahoo.com>
2006-06-18 06:03 ` Oliver Jowett <oliver@opencloud.com>
2006-06-19 13:57   ` Kris Jurka <books@ejurka.com>
2006-06-19 17:38   ` j.random.programmer <javadesigner@yahoo.com>
2006-06-19 22:12     ` Oliver Jowett <oliver@opencloud.com>

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