public inbox for [email protected]
help / color / mirror / Atom feedFrom: Rob Sargent <[email protected]>
To: David G. Johnston <[email protected]>
To: [email protected] <[email protected]>
Cc: JORGE MALDONADO <[email protected]>
Subject: Re: One parent record with 3 possible child records
Date: Thu, 2 May 2024 07:37:14 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwYPeiXTT0GTrN3o7Ja7P9G9Z-LerHsdbzCDqe=SRhffyg@mail.gmail.com>
References: <CAAY=A79usb2Lbr9nUyzxyRNWLQNc-w3oTBbtUGyC2a4E-qaX3A@mail.gmail.com>
<CAKFQuwYPeiXTT0GTrN3o7Ja7P9G9Z-LerHsdbzCDqe=SRhffyg@mail.gmail.com>
> On May 1, 2024, at 5:24 PM, David G. Johnston <[email protected]> wrote:
>
> On Wednesday, May 1, 2024, JORGE MALDONADO <[email protected] <mailto:[email protected]>> 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.
Presuming the id is unique in parent and child, what’s the value of the type field in the foreign key? Are you saying the PK on tableMain is (type,id), perhaps for clustering purposes?
view thread (9+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: One parent record with 3 possible child records
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox