On Oct 17, 6:36 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote:
> On Mon, Oct 13, 2008 at 9:40 AM, Dean Landolt <[EMAIL PROTECTED]> wrote:
> > On Mon, Oct 13, 2008 at 9:44 AM, Kirk Strauser <[EMAIL PROTECTED]> wrote:
>
> >> On Thursday 09 October 2008 14:45:44 Dean Landolt wrote:
> >> > If it's an old table, can't you just do a select distinct to get out the
> >> > relevant data and just stick it somewhere more suitable? If there's
> >> > nothing
> >> > else relevant there, why bother wiring SA up to it on every load? It
> >> > couldn't be that hard to renormalize the data and put it in the place it
> >> > belongs (wherever that is)?
>
> >> I could, but I don't want to have to re-synch it constantly.

You've got a few options, but one of the better ones is to write a
trigger in, say, plpgsql to maintain a properly normalized read-only
form of the table (read-only because otherwise you end up with messy
transaction issues). This avoids the need to "re-synch" but at the
same time gives you a correct view of the table for your model.

The advantage of this approach is that your work becomes reusable for
any other software that needs to talk to the database, and after some
time you may be able to invert it and have the normalized table as the
master and the other table as a view with triggers to accept updates
from the legacy application. There's a book called "Refactoring
Databases" by Ambler and Sadalage which has a pile of patterns for
this kind of problem.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to