Re: Multiple table relationship constraints

From: Rick Genter <rick(dot)genter(at)gmail(dot)com>
To: Jack Christensen <jackc(at)hylesanderson(dot)edu>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>, rick(dot)genter(at)gmail(dot)com
Subject: Re: Multiple table relationship constraints
Date: 2011-05-05 19:53:26
Message-ID: BANLkTinzH+WjR+e68_8rm0Omee=L+0cUxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 5, 2011 at 3:50 PM, Jack Christensen <jackc(at)hylesanderson(dot)edu>wrote:

> The trick is there are additional attributes of actions and achievements
> such as a category that must match for the link to be valid. These
> attributes are not part of the primary key of either record and can and do
> change.
>

So your data is denormalized? (The "category" appears in 2 tables?) Don't do
that. Create a view that joins your two tables together instead if you need
a single entity that contains data from multiple sources. Then you won't
have any of the data integrity issues you're worried about.

--
Rick Genter
rick(dot)genter(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2011-05-05 19:54:51 Re: SSDD reliability
Previous Message Jack Christensen 2011-05-05 19:50:35 Re: Multiple table relationship constraints