Re: Way to stop recursion? - Mailing list pgsql-sql

From Chris Travers
Subject Re: Way to stop recursion?
Date
Msg-id 41AB74CB.5050805@metatrontech.com
Whole thread Raw
In response to Re: Way to stop recursion?  (Jonathan Knopp <pgsql@delegated.net>)
List 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@postgresql.org)
>
>


Attachment

pgsql-sql by date:

Previous
From: "Nurdin"
Date:
Subject: create stored procedure from temporary table
Next
From: Johan Henselmans
Date:
Subject: grouping a many to many relation set