From: Richard Jones <rich@annexia.org>
To: Bruno Wolff III <bruno@wolff.to>
To: pgsql-sql@postgresql.org
Subject: Re: Referential integrity (foreign keys) across multiple tables
Date: Mon, 24 Jul 2006 09:59:07 +0100
Message-ID: <20060724085907.GA19981@furbychan.cocan.org> (raw)
In-Reply-To: <20060723183237.GA22586@wolff.to>
References: <20060722133257.GA9785@furbychan.cocan.org>
<20060723183237.GA22586@wolff.to>
On Sun, Jul 23, 2006 at 01:32:37PM -0500, Bruno Wolff III wrote:
> On Sat, Jul 22, 2006 at 14:32:57 +0100,
> Richard Jones <rich@annexia.org> wrote:
> >
> > Now I want to add a column to page_contents, say called link_name,
> > which is going to reference the pages.url column for the particular
> > host that this page belongs to.
>
> What are you trying to accomplish by this?
Data integrity.
> The information is available by doing a join. If you are trying to
> simplify things for applications, you can probably do it with a view
> or rules depending on whether you want to have an updatable view. If
> you are denormalizing for performance and want constraints to
> maintain consistancy, then you probably want to push the hostid down
> to page_contents as well as the url. These could both be set with a
> trigger. (I think a rule could be used as well.)
So if I get this right, I should use a trigger to ensure that the old
code causes the hostid field to be set in page_contents?
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
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: pgsql-sql@postgresql.org
Cc: rich@annexia.org, bruno@wolff.to
Subject: Re: Referential integrity (foreign keys) across multiple tables
In-Reply-To: <20060724085907.GA19981@furbychan.cocan.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox