Re: continuous copy/update one table to another - Mailing list pgsql-general

From Adrian von Bidder
Subject Re: continuous copy/update one table to another
Date
Msg-id 201003011051.06026@fortytwo.ch
Whole thread Raw
In response to continuous copy/update one table to another  (Terry <td3201@gmail.com>)
List pgsql-general
Hi Terry,

On Sunday 28 February 2010 22.56:41 Terry wrote:
> I am looking for a way to copy all the data from one table to another
> on a regular basis, every 5 minutes let's say.
>
> INSERT INTO table2 SELECT * FROM table1;

Why do you want this?  Is it necessary for the data in table2 to appear only
delayed?

I usually try to avoid all scheduled actions and try to use a "push" or
"pull" model where data is replicated / generated when needed or when it is
generated by the last step.  So to replicate (a part of the) data into a 2nd
table, I'd usually go for triggers, or try to avoid having the data
duplication alltogether.

(But obviously, I don't know what you're doing, this is just my opinion
based on a feeling that the underlying problem you're solving might be
solved in a more elegant way.)

cheers
-- vbi

--
Pzat!

Attachment

pgsql-general by date:

Previous
From: Adrian von Bidder
Date:
Subject: Optimizer: ranges and partial indices? Or use partitioning?
Next
From: AI Rumman
Date:
Subject: current transaction id