continuous copy/update one table to another

Поиск
Список
Период
Сортировка
От Terry
Тема continuous copy/update one table to another
Дата
Msg-id 8ee061011002281356t5239db2qaf10a225dce60e97@mail.gmail.com
обсуждение исходный текст
Ответы Re: continuous copy/update one table to another  (John R Pierce <pierce@hogranch.com>)
Re: continuous copy/update one table to another  (David W Noon <dwnoon@ntlworld.com>)
Re: continuous copy/update one table to another  (Adrian von Bidder <avbidder@fortytwo.ch>)
Список pgsql-general
Hello,

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;

The above will copy all the data as is and insert it into the other
table.  What happens if I rerun it again?  Will it just append table1
again into table2?  How can I have it only insert rows that are
different?  Would that be a program to lookup the most last record in
table 1 and then a query to only select after that row for the insert
into table2?

Thanks!

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Partial foreign keys
Следующее
От: John R Pierce
Дата:
Сообщение: Re: continuous copy/update one table to another