General question

Поиск
Список
Период
Сортировка
От salah jubeh
Тема General question
Дата
Msg-id 592812.2119.qm@web52701.mail.re2.yahoo.com
обсуждение исходный текст
Ответы Re: General question  ("David Johnston" <polobo@yahoo.com>)
Список pgsql-general


 
Hello,
Some times the primary key is the same as the foreign key such as in the following design. which is used to model 1-1 relationship.
In the database books, such as database fundamentals(Masri), the 1-1 relation is modeled by having two separate key. 
when this kind of design (shared key) is preferable and  is there any anomalies to it.
 

create table Table1
( T1_Id    integer     not null primary key
, T1_Data  varchar(9)  not null
)
create table Table2
( T2_Id    integer     not null primary key
, T2_Data  varchar(37) not null
, foreign key (T2_Id) references Table1 (T1_Id)
)
 

Thanks in advance

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Schreyer
Дата:
Сообщение: Re: Weird problems with C extension and bytea as input type
Следующее
От: Martín Marqués
Дата:
Сообщение: pg_dump problems