On 9/17/2015 12:31 AM, Raman, Karthik
IN BLR STS wrote:
to copy the data directory and have it be useful you need to bracket the copy with calls to pg_start_backup() and pg_stop_backup() .... this ensures the data files are coherent. this is in fact what pg_basebackup does for you.... if the data is large enough that regular full copies are expensive, you might consider implementing a WAL archive system. you would periodically do a pg_basebackup as above, and also maintain a WAL archive of all wal files since the beginning of the base backup. you can use thise base backup plus wal archive to implement 'Point In Time Recovery' or PITR, which will let you restore the database to just before any specified transaction number, so if bad data got introduced, you can restore it to just prior to that point. you might read all of this chapter in the manual... http://www.postgresql.org/docs/9.4/static/backup.html -- john r pierce, recycling bits in santa cruz |