Re: Way to stop recursion?

From: Chris Travers <chris(at)metatrontech(dot)com>
To: Jonathan Knopp <pgsql(at)delegated(dot)net>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Way to stop recursion?
Date: 2004-11-29 19:13:15
Message-ID: 41AB74CB.5050805@metatrontech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)postgresql(dot)org)
>
>

Attachment Content-Type Size
chris.vcf text/x-vcard 127 bytes

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Johan Henselmans 2004-11-29 20:26:13 grouping a many to many relation set
Previous Message RobertD.Stewart 2004-11-29 18:37:42 stored procedures in postgresql user plpgsql