pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Travers <chris@metatrontech.com>
To: Jonathan Knopp <pgsql@delegated.net>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Way to stop recursion?
Date: Mon, 29 Nov 2004 11:13:15 -0800
Message-ID: <41AB74CB.5050805@metatrontech.com> (raw)
In-Reply-To: <41A7A5C2.6080800@delegated.net>
References: <41A79A2A.6070606@delegated.net>
	<19345.1101504671@sss.pgh.pa.us>
	<41A7A5C2.6080800@delegated.net>

Jonathan Knopp wrote:

>
> Sorry, I should have mentioned that there is a lot more to the design 
> that makes this replication necessary, including another two levels to 
> the tree plus the ability to have orphaned children.
>
My first thought was "Dude, use a VIEW...."

In database design, the SPOT principle applies.  *Always* enforce a 
Single Point Of Truth.  If that doesn't seem to be possible, rethink how 
the data is used and look at how to ensure that there is only ONE 
authoritative storeage for each piece of transactional data. (Yes, 
sometimes we get away from this with OLAP installations but the data is 
not generally being updated there.)

In this case, I would create a view (with appropriate rules) which would 
automatically populate the common fields from the parent if it exists.  
The issue should not be one of storage but of presentation.

Best Wishes,
Chris Travers
Metatron Technology Consulting

> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>

Attachments:

chris.vcf (text/x-vcard, 125B) download begin:vcard fn:Chris Travers n:Travers;Chris email;internet:chris@metatrontech.com x-mozilla-html:FALSE version:2.1 end:vcard

view thread (8+ messages)

Message-ID: <41AB74CB.5050805@metatrontech.com>
Permalink:  ../41AB74CB.5050805@metatrontech.com/
Also on:    postgresql.org/message-id/41AB74CB.5050805@metatrontech.com

 · 

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: pgsql-sql@postgresql.org
  Cc: chris@metatrontech.com, pgsql@delegated.net
  Subject: Re: Way to stop recursion?
  In-Reply-To: <41AB74CB.5050805@metatrontech.com>

* 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