Re: how could a foreign key ever be NULL?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: how could a foreign key ever be NULL?
Дата
Msg-id 200112171706.fBHH6Bh06057@candle.pha.pa.us
обсуждение исходный текст
Ответ на how could a foreign key ever be NULL?  (Terrence Brannon <metaperl@mac.com>)
Список pgsql-sql
> The Momjian book states:
> 
> A single-column foreign key is either NULL or matches a primary key
> 
> But the problem I have with this statement is that a primary key 
> cannot be null or duplicate. And since the foreign key references 
> a value that is neither null or duplicate, how could it ever be 
> NULL?

Uh, you could have a foreign key row that doesn't match a primary key
row, and is hence NULL, can't you?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Terrence Brannon
Дата:
Сообщение: how could a foreign key ever be NULL?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Numbering Rows (SEQUENCE, OID) questions