Re: Way to stop recursion?

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: Way to stop recursion?
Дата
Msg-id 41AB74CB.5050805@metatrontech.com
обсуждение исходный текст
Ответ на Re: Way to stop recursion?  (Jonathan Knopp <pgsql@delegated.net>)
Список 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)
>
>


Вложения

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Nurdin"
Дата:
Сообщение: create stored procedure from temporary table
Следующее
От: Johan Henselmans
Дата:
Сообщение: grouping a many to many relation set