Re: continuous copy/update one table to another

Поиск
Список
Период
Сортировка
От Adrian von Bidder
Тема Re: continuous copy/update one table to another
Дата
Msg-id 201003011051.06026@fortytwo.ch
обсуждение исходный текст
Ответ на continuous copy/update one table to another  (Terry <td3201@gmail.com>)
Список 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!

Вложения

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

Предыдущее
От: Adrian von Bidder
Дата:
Сообщение: Optimizer: ranges and partial indices? Or use partitioning?
Следующее
От: AI Rumman
Дата:
Сообщение: current transaction id