Re: Supertypes?

From: will trillich <will(at)serensoft(dot)com>
To: "[GENERAL] PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Supertypes?
Date: 2001-03-27 17:00:29
Message-ID: 20010327110029.B1685@mail.serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)serensoft(dot)com
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-03-27 17:33:53 Re: Re: Patch (tiny): \cd (change dir) for psql.
Previous Message will trillich 2001-03-27 16:52:19 Re: Re: Patch (tiny): \cd (change dir) for psql.