Re: Supertypes? - Mailing list pgsql-general

From will trillich
Subject Re: Supertypes?
Date
Msg-id 20010327110029.B1685@mail.serensoft.com
Whole thread Raw
In response to RE: Supertypes?  ("Christian Marschalek" <cm@chello.at>)
List pgsql-general
On Tue, Mar 27, 2001 at 03:58:39PM +0200, Christian Marschalek wrote:
> > Pg DOES support it!
> Oh... My fault :o)
>
> > However, it doesn't really have anything
> > to do with data redundancy.  Data redundancy means storing
> > the same DATA in more than one table meaning that if it
> > changes in one table, you have to update all of the other
> > tables.  That's not the same as inheritance which means you
> > can use a common base_table with additions to child tables as
> > necessary.
> Well we've learned that when you have lets say five tables which all
> contain name, adresse, city and so on you also have a form of
> redundancy... Can be wrong, though ;o)

there's also this construct -- i don't know the name --
exemplified below by using the table ADDR (very u.s.centric, i
know) as a DATATYPE in table PERSON:

    create table addr(
        street varchar(30),
        city varchar(30),
        state char(2),
        zip char(5)
    );
    create table person(
        loc addr,  --  how about them apples?
        phone char(10),
        name varchar(30)
    );
    \d person
               Table "person"
     Attribute |    Type     | Modifier
    -----------+-------------+----------
     loc       | addr        |
     phone     | char(10)    |
     name      | varchar(30) |


the trick, is, how do you insert data into person.addr?

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

pgsql-general by date:

Previous
From: "Poul L. Christiansen"
Date:
Subject: Re: .mdb to Postgres ?
Next
From: will trillich
Date:
Subject: Re: Re: Patch (tiny): \cd (change dir) for psql.