Re: Archival of Live database to Historical database

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Stef Telford" <stef(at)Chronozon(dot)dyndns(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Archival of Live database to Historical database
Date: 2001-01-30 09:09:18
Message-ID: 00cb01c08a9c$559a9820$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

From: "Stef Telford" <stef(at)Chronozon(dot)dyndns(dot)org>

> Hello everyone,
> I have hit on a limit in my knowledge and i am looking for
> some guidance. Currently I have two seperate databases, one for
> live data, the other for historical data. The only difference really
> being that the historical data has a Serial in it so that the tables
> can keep more than one 'version history'.
>
> What i would like to do, is after my insert transaction to the
> live database, i would like the information also transferred to the
> historical one. Now. I can do this via perl (and i have been doing it
> this way) and using two database handles. This is rather clumsy and
> I know there must be a 'better' or more 'elegant' solution.

Not really (AFAIK) - this crops up fairly regularly but there's no way to do
a cross-database query.

You could use rules/triggers to set a "dirty" flag for each record that
needs copying - but it sounds like you're already doing that.

If you wanted things to be more "real-time" you could look at LISTEN/NOTIFY

- Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2001-01-30 09:09:57 Re: script for unidirectional database update
Previous Message Markus Wagner 2001-01-30 06:38:33 script for unidirectional database update