sql - Copying table records after a specific file interval in Postgresql -
i have table records want copy db on remote server after specific interval of time. number of records in table high(in range of millions) , columns can range 40-50.
i thought using pg_dump after time-interval sounds inefficient whole table dumped again , again.
assume time interval 4 hours , life-cycle of db start @ 10:00.
no. of records @ 10:00 - 0
no. of records @ 14:00 - n
no. of records @ 18:00 - n+m
no. of records @ 22:00 - n+m+l
the script(shell) want write should select 0 rows @ 10:00, n rows @ 14:00, m rows @ 18:00, l rows @ 22:00.
is there other way through copy rows have been added between time intervals in order remove redundant rows come if take pg_dump every 4 hours?
Comments
Post a Comment