Re: Foreign key to a partial key

Поиск
Список
Период
Сортировка
От Simon G
Тема Re: Foreign key to a partial key
Дата
Msg-id CAH5GJU8LEoTLWtJoGiVGF0RVQF=Gr81-BwzBC6iuq4qs=kJZsw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Foreign key to a partial key  (David Johnston <polobo@yahoo.com>)
Список pgsql-sql
Hello, David:

You are absolutely right.

I was wrong. Although the wbs_code is not a surrogate key, I was using it like it was.
A product may have a wbs_code, but from a wbs_name, It cannot exists alone. So wbs_name has to be included in the products table. My mistake.

Your solution is what needed to be done. A FK referencing projects (wbs_name, project_id) ensures that the wbs_name used in the product is the proper wbs_name of the project. I already tried it and it works.

Thank you very much.

Simon Graffe

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

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: Foreign key to a partial key
Следующее
От: ssylla
Дата:
Сообщение: problem with update order (?)