Re: Question of Table Design and Foreign Keys - Mailing list pgsql-admin

From David Pratt
Subject Re: Question of Table Design and Foreign Keys
Date
Msg-id BD59D321-D1F1-11D9-AEE7-000A27B3B070@eastlink.ca
Whole thread Raw
In response to Re: Question of Table Design and Foreign Keys  ("Jason Minion" <jason.minion@sigler.com>)
List pgsql-admin
Hi Jason, many thanks Jason for your reply.

On Tuesday, May 31, 2005, at 11:25 AM, Jason Minion wrote:

> I think the way you want to look at it is: if a record exists in
> sample_attributesjoin, then it needs to reference both samples
> and attributes. You don't need to worry about samples or attributes
> being "off" because they don't have "enough" references, instead
> you want to ensure that if a record exists (whether inserted,
> updated, or references are deleted) in sample_attributesjoin
> that the sample_id and attribute_id are always valid.
>

Yes, this is what I was thinking but just needed to ensure this was the
right approach since I have a number of tables and similar
circumstances.  So if there is no attributes for a sample record when I
  join the tables and query, I will just have nothing returned for these
records and no trouble with integrity, am I correct? When I up update
or delete records that I have added to attributesjoin, the referential
integrity of attributes and samples table is maintained using the
constraints, have I got this right?

Regards,
David

pgsql-admin by date:

Previous
From: Devrim GUNDUZ
Date:
Subject: Re: RHE v3
Next
From: ASIS Mexico Norte
Date:
Subject: Foro Regional Especializado 2005 - Seguridad en el Autotransporte