Re: One parent record with 3 possible child records

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: One parent record with 3 possible child records
Дата
Msg-id CAKFQuwYPeiXTT0GTrN3o7Ja7P9G9Z-LerHsdbzCDqe=SRhffyg@mail.gmail.com
обсуждение исходный текст
Ответ на One parent record with 3 possible child records  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Ответы Re: One parent record with 3 possible child records  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-sql
On Wednesday, May 1, 2024, JORGE MALDONADO <jorgemal1960@gmail.com> wrote:

Let's say that tableMain has a string field called "type" with the following possible values: "residential", "industrial" and "energy". 

This, and have the same column in the other tables, but add a check constraint ensuring only the correct enum value can be specified.  Then your foreign key from the child tables to main is both the ID and the type field.
 
David J.

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

Предыдущее
От: JORGE MALDONADO
Дата:
Сообщение: One parent record with 3 possible child records
Следующее
От: Sanjay Minni
Дата:
Сообщение: Re: One parent record with 3 possible child records