Re: Referencing multiple primary keys from a single table.

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Referencing multiple primary keys from a single table.
Дата
Msg-id 20030922150356.K11175@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Referencing multiple primary keys from a single table.  (Daniel Staal <DStaal@usa.net>)
Ответы Re: Referencing multiple primary keys from a single
Список pgsql-novice
On Mon, 22 Sep 2003, Daniel Staal wrote:

>
> What is the best way to reference (use as foreign key) a table with
> multiple primary keys?
>
> Here's what I have:
> Table1:
> field1
> field2
> field3
> ...
> primary key (field1, field2, field3)

This isn't multiple primary keys, it's a single primary key with
3 columns.

> Then I have another table that needs to reference Table1 with a
> foreign key.  What I really want to do is:
> Table2:
> field1 Primary key
> field2 references table1

What are you actually trying to do here?  field2 is a single column
and you're referencing a 3 column key, so I'm not sure what behavior
you're looking for.

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