Skip site navigation (1) Skip section navigation (2)

Re: Question of Table Design and Foreign Keys

From: David Pratt <fairwinds(at)eastlink(dot)ca>
To: Jason Minion <jason(dot)minion(at)sigler(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Question of Table Design and Foreign Keys
Date: 2005-05-31 16:33:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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?


In response to

pgsql-admin by date

Next:From: Marc G. FournierDate: 2005-05-31 17:45:56
Subject: Major flood of mail to lists ...
Previous:From: MyliDate: 2005-05-31 15:44:46
Subject: new antidote discovered

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group