Re: Supertypes?
От | will trillich |
---|---|
Тема | Re: Supertypes? |
Дата | |
Msg-id | 20010327110029.B1685@mail.serensoft.com обсуждение исходный текст |
Ответ на | RE: Supertypes? ("Christian Marschalek" <cm@chello.at>) |
Список | 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 по дате отправления: