Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 0DECD2E00ED for ; Fri, 21 Dec 2007 22:03:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 12418-09 for ; Fri, 21 Dec 2007 22:02:50 -0400 (AST) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.187]) by postgresql.org (Postfix) with ESMTP id 0C56F2E00F1 for ; Fri, 21 Dec 2007 22:02:55 -0400 (AST) Received: by rv-out-0910.google.com with SMTP id l15so746580rvb.43 for ; Fri, 21 Dec 2007 18:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; bh=8sOpytaOXibuYHGX73UNaws29Ik9t93ilt8JfkoG2B4=; b=bE5148/NzWcb9ednjR9vhq8QAiOuYh+KruUafBxTq8d02AEa4pLoYjGsGNCEhRrTh3DxbRqtYuXUyDL/WYX3y7iUYon2dUUVcQR0Wgcro5xDqS2JH9c9BmcGDJSzFcCuWDPWP0T4I6ke5FYpFFtTzMJBcd846wN2b92nZSzgdNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; b=QVTjha1MGvYSrKDqziyx/Vz0o7AQ0GvDv19WBRI2uLxt874L7T1878ZP91QFPWBhFe0ZkK33dLhZ3fp50Z2qNqRPDNW2bs+vmpuppBKY9ofAfqshq4eZJPVZip7lRXvsMFswDHmagiveaNqzepHfPTpgdx4pgO7hjCL7ezb7QZY= Received: by 10.140.177.15 with SMTP id z15mr1154588rve.110.1198288974282; Fri, 21 Dec 2007 18:02:54 -0800 (PST) Received: from ?192.168.1.2? ( [220.233.16.89]) by mx.google.com with ESMTPS id g1sm3455034rvb.0.2007.12.21.18.02.52 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2007 18:02:53 -0800 (PST) Message-Id: <0FBA939C-2ED1-4400-BD3B-5290193837D0@gmail.com> From: Tom Davies To: pgsql-admin@postgresql.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: on-line backup questions Date: Sat, 22 Dec 2007 13:02:50 +1100 X-Mailer: Apple Mail (2.915) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/200 X-Sequence-Number: 27717 I've been working on backup restore scripts for a PostgreSQL DB hosted on an Amazon EC2 instance. EC2 instances don't have any persistent storage, so I archive the WAL files to Amazon S3. I do periodic backups, and restore and roll forward when an instance is restarted. I've followed the excellent documentation at http://www.postgresql.org/docs/8.0/interactive/backup-online.html , and everything is working well, but I have a few further questions. 1. Purely out of curiousity, what's the nnnnnnnn.history file which is requested from the archive when you restore? I realise that the restore process looking for files which don't exist is not a problem, I'm just being inquisitive. 2. When I do a backup, Postgres requests archiving of n.m.backup and the WAL file n immediately, so I only copy WAL files with numbers > n from pg_xlog. I've seen suggestions that I should be copying WAL files with numbers >= n -- is there any reason to do so? 3. What's the best thing to do when I deliberately shut down PostgreSQL (i.e. pg_ctl stop)? When I start again I will be restoring from the most recent backup and rolling forward over the archived WAL files. I believe that shutdown leaves me with unarchived WAL files in pg_xlog. Can I simply copy these to S3 as if they were WAL files which were copied from pg_xlog at the time of the last backup, and then put them back into pg_xlog as part of my restore process? 4. I'm using PostgreSQL 8.0 -- are there any significant improvements in on-line backups in later versions? Thanks, Tom