Re: User-Defined Datatypes - Mailing list pgsql-general

From elein
Subject Re: User-Defined Datatypes
Date
Msg-id 5.1.0.14.0.20020415124508.024311c8@office.nextbus.com
Whole thread Raw
In response to Re: User-Defined Datatypes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Illustra (rip) did support create type in this way.
It is a sad failing for postgreSQL that it does not
enable creation of composite types and inherited
types (other than tables).  The ability to store a
row (or rows!) in a column was a useful and valuable
idea.

You can of course create your own datatype in C
in postgreSQL but you must contain each subreference
with accessor functions.

There doesn't seem to be an emphasis on the ability
of postgreSQL to create a more full featured type system.
I would use a function that created tuples in a second.
The ability to subtype existing base data types made
creating uniquely sorted or manipulated types very easy.

I do however understand the underlying reasons why postgreSQL
has not gone the way illustra did in this way.  Technically,
some of it is tricky (but possible!) and because of slow adoption
only us die-hard OR people really used the capabilities.

PostgreSQL seems to be turning away from its OR roots into
more of a transactional db system.  I, for one, use postgreSQL
because it is an ORDBMS so this is sad.  With the gobbling
of illustra-informix-ibm, extensibility is an asset that can and should
stand out with the database community.



elein@nextbus.com
       and not or

(PS: I can write functional specs if someone wants to implement
any of an extended type system :-)

At 03:04 PM 4/15/2002 -0400, Tom Lane wrote:
>Philip Reimer <phre@wi.uni-muenster.de> writes:
> > Is it possible to create new structured datatypes in PostgreSQL like in
> this
> > IBM UDB2 statement:
>
> > create type person_t as (
> > name varchar(30),
> > car car_t)
>
> > create type car_t as (
> > model varchar(30),
> > plate carchar(20))
>
> > create table car of car_t
> > create table person of person_t
>
>We don't support that syntax, but you can achieve approximately the same
>effect using inheritance:
>
>         create table person_t ( ... );
>
>         create table person () inherits(person_t);
>
>Very often, the parent table of an inheritance relationship isn't
>intended to ever actually contain any rows itself.  In that case the
>parent is effectively serving as a datatype, or at least you could
>think of it that way.
>
>                         regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster


pgsql-general by date:

Previous
From: Dmitry Tkach
Date:
Subject: Re: Alter/update large tables - VERRRY annoying behaviour!
Next
From: Boris Köster
Date:
Subject: Mass-Data question