Re: one-to-one

Поиск
Список
Период
Сортировка
Искать
От
Adrian Holovaty
Тема
Re: one-to-one
Дата
Msg-id
200308211332.03345.postgres@holovaty.com
Ответ на
Re: one-to-one (Josh Berkus)
Список
Дерево обсуждения
one-to-one Michael Grant <soft@bdanube.com>
Re: one-to-one Josh Berkus <josh@agliodbs.com>
Re: one-to-one Adrian Holovaty <postgres@holovaty.com>
Re: one-to-one Josh Berkus <josh@agliodbs.com>
Re: one-to-one Michael Grant <soft@bdanube.com>
Re: one-to-one Josh Berkus <josh@agliodbs.com>
Almost relational PostgreSQL (was: one-to-one) Michael Glaesmann <grzm@myrealbox.com>
Re: Almost relational PostgreSQL (was: one-to-one) Josh Berkus <josh@agliodbs.com>
Re: Almost relational PostgreSQL (was: one-to-one) Michael Glaesmann <grzm@myrealbox.com>
Re: one-to-one Jason Hihn <jhihn@paytimepayroll.com>
Josh Berkus wrote:
> create table people (
> 	id SERIAL PRIMARY KEY
> 	name
> 	address ....
> );
> create table member_info (
> 	id INT REFERENCES people(id) PRIMARY KEY
> 	orientation
> 	officer ...
> );
> Using ID both as PK and as an FK in the member_info table creates a 1:0-1
> relationship.

What are the advantages and disadvantages of this approach over table 
inheritance?

create table people (
   id SERIAL PRIMARY KEY
   name
   address ....
);
create table members (
   orientation
   officer ...
) inherits people;

Adrian
В списке pgsql-novice по дате отправления
От: Josh Berkus
Дата:
Сообщение: Re: one-to-one
От: Jason Hihn
Дата:
Сообщение: Re: one-to-one
FAQ