Re: Foreign key to a partial key

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Foreign key to a partial key
Дата
Msg-id 1394332674081-5795296.post@n5.nabble.com
обсуждение исходный текст
Ответ на Foreign key to a partial key  (Simon G <simonjgl@gmail.com>)
Ответы Re: Foreign key to a partial key  (Simon G <simonjgl@gmail.com>)
Список pgsql-sql
> I thought of creating a foreign key constraint this way:
> 
> The constraint would need to make reference to the wbs_name assigned to
> the
> project, but at the table products, no column contains that info.

Add the wbs_name column to the products table.  Since a code is invalid
without knowing which project it belongs to your table definition is wrong.

Then you can create the proper two-column foreign key that references on
primary key on the codes table.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Foreign-key-to-a-partial-key-tp5795291p5795296.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



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

Предыдущее
От: Simon G
Дата:
Сообщение: Foreign key to a partial key
Следующее
От: Simon G
Дата:
Сообщение: Re: Foreign key to a partial key